/// <summary>
        /// Received when a story should be started by the reader
        /// </summary>
        /// <param name="eventdata"></param>
        void OnNewStory(StoryEvent eventdata)
        {
            Trace.Script("Reading " + eventdata.storyFile.name, this);
            var e = new Story.LoadEvent();

            e.storyFile = eventdata.storyFile;
            e.knot      = eventdata.knot;
            e.restart   = eventdata.Restart;
            reader.gameObject.Dispatch <Story.LoadEvent>(e);
        }
Example #2
0
 void OnLoadEvent(Story.LoadEvent e)
 {
     // If we are currently in the middle of a story, have allowed stories to be queued, and this story
     // requests to be queued...
     if (currentlyReading && queueStories && e.queue)
     {
         if (debug)
         {
             Trace.Script($"Queued up <i>{e.storyFile.name}</i>");
         }
         storyQueue.Enqueue(e);
     }
     // Otherwise take over the current story
     else
     {
         this.LoadStory(e.storyFile, e.restart, e.knot);
     }
 }