Implement final scene
This commit is contained in:
@@ -16,7 +16,7 @@ public class DialogManager : Singleton<DialogManager>
|
||||
{
|
||||
private GuardManager currentGuard;
|
||||
|
||||
private JObject dialogTree;
|
||||
public JObject dialogTree;
|
||||
|
||||
[CanBeNull] private JObject currentItem;
|
||||
|
||||
@@ -25,8 +25,8 @@ public class DialogManager : Singleton<DialogManager>
|
||||
|
||||
public GameObject AskButton;
|
||||
|
||||
private Transform QuestionOptionArea;
|
||||
private Transform QuestionInfillArea;
|
||||
public Transform QuestionOptionArea;
|
||||
public Transform QuestionInfillArea;
|
||||
|
||||
private Stack<string> FullQuestionPrefixes = new Stack<string>();
|
||||
private string FullQuestion;
|
||||
@@ -62,7 +62,13 @@ public class DialogManager : Singleton<DialogManager>
|
||||
public void StartDialog(GuardManager guardId)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
dialogTree = LevelLoader.Instance.SpeechTree;
|
||||
AskButton.SetActive(false);
|
||||
QuestionOptionArea = transform.FindChildRecursive("ADDQOPTIONSHERE");
|
||||
if (!GlobalStateManager.Instance.finalScene)
|
||||
{
|
||||
dialogTree = LevelLoader.Instance.SpeechTree;
|
||||
}
|
||||
|
||||
|
||||
currentGuard = guardId;
|
||||
currentItem = dialogTree;
|
||||
@@ -85,6 +91,7 @@ public class DialogManager : Singleton<DialogManager>
|
||||
|
||||
foreach (var kvp in currentItem)
|
||||
{
|
||||
Debug.Log(kvp.ToString());
|
||||
//special keywords
|
||||
if (kvp.Key == "DOORS")
|
||||
{
|
||||
@@ -137,7 +144,13 @@ public class DialogManager : Singleton<DialogManager>
|
||||
AudioManager.Instance.PlaySound("WordAdd");
|
||||
if (kvp.Value is JValue)
|
||||
{
|
||||
AddQuestionInfill(currentItem, kvp.Key + "?");
|
||||
string addition = "?";
|
||||
if (GlobalStateManager.Instance.finalScene)
|
||||
{
|
||||
addition = ".";
|
||||
}
|
||||
|
||||
AddQuestionInfill(currentItem, kvp.Key + addition);
|
||||
|
||||
currentItem = null;
|
||||
AskButton.SetActive(true);
|
||||
@@ -259,8 +272,12 @@ public class DialogManager : Singleton<DialogManager>
|
||||
}
|
||||
|
||||
|
||||
var cdoor = LevelLoader.Instance.Doors.First((d) => d.type == "LIFE");
|
||||
response = response.Replace("CDOOR", cdoor.mod.Replace("#",""));
|
||||
var cdoor = LevelLoader.Instance.Doors.FirstOrDefault((d) => d.type == "LIFE");
|
||||
if (cdoor != null)
|
||||
{
|
||||
response = response.Replace("CDOOR", cdoor.mod.Replace("#",""));
|
||||
}
|
||||
|
||||
|
||||
response = response.Replace("$", "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user