done for the night
This commit is contained in:
@@ -294,15 +294,14 @@ public class CameraController : MonoBehaviour
|
||||
RemoveHighlight();
|
||||
currentlyHoveredRenderer = hitRenderer;
|
||||
|
||||
if (currentlyHoveredRenderer is SpriteRenderer sprite)
|
||||
if (currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != null)
|
||||
{
|
||||
originalColour = sprite.color;
|
||||
sprite.color = highlightColour;
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>().isfocussed = 1;
|
||||
}
|
||||
else
|
||||
|
||||
if (currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != null)
|
||||
{
|
||||
originalColour = currentlyHoveredRenderer.material.color;
|
||||
currentlyHoveredRenderer.material.color = highlightColour;
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>().isfocussed = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -316,13 +315,21 @@ public class CameraController : MonoBehaviour
|
||||
{
|
||||
if (currentlyHoveredRenderer != null)
|
||||
{
|
||||
if (currentlyHoveredRenderer is SpriteRenderer sprite)
|
||||
|
||||
if (
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != null &&
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>() != currentDoorManager
|
||||
)
|
||||
{
|
||||
sprite.color = originalColour;
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<DoorManager>().isfocussed = 0;
|
||||
}
|
||||
else
|
||||
|
||||
if (
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != null &&
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>() != currentGuardManager
|
||||
)
|
||||
{
|
||||
currentlyHoveredRenderer.material.color = originalColour;
|
||||
currentlyHoveredRenderer.gameObject.GetComponentInParent<GuardManager>().isfocussed = 0;
|
||||
}
|
||||
|
||||
currentlyHoveredRenderer = null;
|
||||
@@ -359,22 +366,33 @@ public class CameraController : MonoBehaviour
|
||||
if (talkButton != null) talkButton.gameObject.SetActive(false);
|
||||
if (doorButton != null) doorButton.gameObject.SetActive(false);
|
||||
|
||||
|
||||
UnsetAll();
|
||||
currentDoorManager = null;
|
||||
currentGuardManager = null;
|
||||
|
||||
|
||||
if (guard != null)
|
||||
{
|
||||
TutorialManager.Instance.LogAction("TAP");
|
||||
AudioManager.Instance.PlaySound("WordAdd");
|
||||
currentGuardManager = guard;
|
||||
guard.isfocussed = 2;
|
||||
if (talkButton != null) talkButton.gameObject.SetActive(true);
|
||||
}
|
||||
else if (door != null)
|
||||
{
|
||||
TutorialManager.Instance.LogAction("TAP");
|
||||
AudioManager.Instance.PlaySound("WordAdd");
|
||||
currentDoorManager = door;
|
||||
door.isfocussed = 2;
|
||||
if (doorButton != null) doorButton.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ReturnToMainCamera();
|
||||
AudioManager.Instance.PlaySound("WordRemove");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,8 +400,9 @@ public class CameraController : MonoBehaviour
|
||||
{
|
||||
if (currentGuardManager != null)
|
||||
{
|
||||
AudioManager.Instance.PlaySound("Select");
|
||||
DialogManager.Instance.StartDialog(currentGuardManager);
|
||||
talkButton.gameObject.SetActive(false);
|
||||
// talkButton.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,6 +411,7 @@ public class CameraController : MonoBehaviour
|
||||
if (currentDoorManager != null && currentDoorManager.doorCamera != null &&
|
||||
currentDoorManager.doorSplineDolly != null)
|
||||
{
|
||||
AudioManager.Instance.PlaySound("Select");
|
||||
doorButton.gameObject.SetActive(false);
|
||||
StartCoroutine(DoorSequenceRoutine(currentDoorManager));
|
||||
}
|
||||
@@ -417,6 +437,7 @@ public class CameraController : MonoBehaviour
|
||||
currentGuardManager = null;
|
||||
currentDoorManager = null;
|
||||
|
||||
UnsetAll();
|
||||
if (talkButton != null) talkButton.gameObject.SetActive(false);
|
||||
if (doorButton != null) doorButton.gameObject.SetActive(false);
|
||||
}
|
||||
@@ -433,4 +454,18 @@ public class CameraController : MonoBehaviour
|
||||
explorationCamera.transform.rotation = startingRotation;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void UnsetAll()
|
||||
{
|
||||
foreach (var doorManager in LevelLoader.Instance.Doors)
|
||||
{
|
||||
doorManager.isfocussed = 0;
|
||||
}
|
||||
foreach (var doorManager in LevelLoader.Instance.Guards)
|
||||
{
|
||||
doorManager.isfocussed = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -280,6 +280,13 @@ public class DialogManager : Singleton<DialogManager>
|
||||
|
||||
|
||||
response = response.Replace("$", "");
|
||||
|
||||
|
||||
if (GlobalStateManager.Instance.finalScene)
|
||||
{
|
||||
response = response.Replace("OK", EndSceneManager.Instance.isPos? "This pleases me" : "This displeases me");
|
||||
}
|
||||
|
||||
|
||||
string responsePrefix = "";
|
||||
if (FullQuestion.Contains("%"))
|
||||
|
||||
@@ -67,10 +67,12 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
else if (mod == "#ONE")
|
||||
{
|
||||
oneDeath.gameObject.SetActive(true);
|
||||
yellowlight.SetActive(true);
|
||||
}
|
||||
else if (mod == "#MANY")
|
||||
{
|
||||
manyDeath.gameObject.SetActive(true);
|
||||
yellowlight.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -2,10 +2,22 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Utils;
|
||||
|
||||
public class EndSceneManager : MonoBehaviour
|
||||
public class EndSceneManager : Singleton<EndSceneManager>
|
||||
{
|
||||
public TextAsset data;
|
||||
|
||||
|
||||
public bool isPos;
|
||||
|
||||
public Image kingRend;
|
||||
|
||||
public Sprite hap;
|
||||
public Sprite sad;
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
@@ -14,12 +26,12 @@ public class EndSceneManager : MonoBehaviour
|
||||
var text = data.ToString();
|
||||
DialogManager.Instance.dialogTree = JObject.Parse(text)["dialog"] as JObject;
|
||||
DialogManager.Instance.StartDialog(GetComponent<GuardManager>());
|
||||
|
||||
isPos = Random.Range(0f, 1f) > 0.5f;
|
||||
StartCoroutine(DoSomethingAfterOneSecond());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
IEnumerator DoSomethingAfterOneSecond()
|
||||
{
|
||||
@@ -28,6 +40,11 @@ public class EndSceneManager : MonoBehaviour
|
||||
// Code to run after 1 second
|
||||
DialogManager.Instance.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void SetFace()
|
||||
{
|
||||
kingRend.sprite = isPos ? hap : sad;
|
||||
}
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Utils;
|
||||
|
||||
public class GlobalStateManager : Singleton<GlobalStateManager>
|
||||
|
||||
@@ -51,6 +51,11 @@ public class SpeechManager : Singleton<SpeechManager>
|
||||
}
|
||||
else if (textBuffer.Count > 0)
|
||||
{
|
||||
//BORKBORKBORKBORK
|
||||
if (GlobalStateManager.Instance.finalScene)
|
||||
{
|
||||
EndSceneManager.Instance.SetFace();
|
||||
}
|
||||
NextText();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user