public void HandleSwitch(string newStory) { if (!InkDatabase.Contains(newStory)) { Debug.LogError("Dialogues didn't contain " + newStory + "! Make sure we're in the right spot and everything is spelled right."); return; } StartDialogue(newStory); }
public void StartDialogue(string dialName, string overrideStart = "START") { CurrentDialogue = new Ink.Runtime.Story(InkDatabase.Get(dialName).text); //currently doesn't care about name. need to load from resources. if (overrideStart != "START") { CurrentDialogue.ChoosePathString(overrideStart); } Setup(); RefreshView(); }
public void ChangeStoryPoint(string newStoryPoint, bool overrideSequencing = false) //?? { string previousStoryPoint = Storage.CurrentStoryPoint; Storage.CurrentStoryPoint = newStoryPoint; Debug.Log("Loading new story point: " + newStoryPoint); //load story point normally if it exists in database. if (InkDatabase.Contains(newStoryPoint)) { //it's a dialogue. let's assume we should start this dialogue if (overrideSequencing) { ui.SetSoleCanvas(UIManager.CanvasType.Main); //TODO: This is ugly. inkDia.StartDialogue(newStoryPoint, startNode); } else { sequences.RunSequence(SequenceName.LoadToStoryFromDrone, () => { ui.SetSoleCanvas(UIManager.CanvasType.Main); inkDia.StartDialogue(newStoryPoint, startNode); }); } return; } //DO DRONE SHIT if (newStoryPoint == GlobalVariables.DRONE) { if (overrideSequencing) { ui.SetSoleCanvas(UIManager.CanvasType.Drone); nodemap.LoadNodeSpace(); Sound.instance.PlayAmbient(Sound.AMBIENCES.Drone); Glitch.instance.EnableDroneEffects(); } else { sequences.RunSequence(SequenceName.LoadToDrone, () => { ui.SetSoleCanvas(UIManager.CanvasType.Drone); nodemap.LoadNodeSpace(); }); } return; } if (newStoryPoint == GlobalVariables.FIRST_CRASH) { sequences.RunSequence(SequenceName.FirstCrash, () => { ChangeStoryPoint(GlobalVariables.DRONE); }); return; } //Throw error if the change didn't actually work. Debug.LogError(newStoryPoint + " Didn't result in any story point. Soemthing went wrong."); }