//------------------------------------------------------------------------------------------/ // Methods: Parsing //------------------------------------------------------------------------------------------/ /// <summary> /// Starts the current dialog. /// </summary> void StartStory(bool resume = false) { // If a knot has been selected... if (story.startingKnot.Length > 0) { this.JumpToKnot(story.startingKnot); } // Inform the space that dialog has started var startedEvent = new StratusStory.StartedEvent() { reader = this, story = story }; // Dispatch to this gameobject and the scene this.gameObject.Dispatch <StratusStory.StartedEvent>(startedEvent); StratusScene.Dispatch <StratusStory.StartedEvent>(startedEvent); onStoryStarted?.Invoke(story); currentlyReading = true; // Update the first line of dialog this.ContinueStory(!resume); story.started = true; if (debug) { StratusDebug.Log($"The story {story.name} has started at the knot '{latestKnot}'"); } }
void OnStoryStartedEvent(StratusStory.StartedEvent e) { if (ValidateStory(e)) { this.Activate(); } }
//------------------------------------------------------------------------------------------/ // Events //------------------------------------------------------------------------------------------/ /// <summary> /// Received when a story has started /// </summary> /// <param name="e"></param> void OnStoryStartedEvent(StratusStory.StartedEvent e) { reader = e.reader; story = e.story; OnStoryStarted(); }