Example #1
0
        public void NextNode()
        {
            current = current.GetNextNode();

            // TODO replace this with an event that an interface can react to
            DisplayNode(current);

            PeekNext();
        }
Example #2
0
 private void DisplayNode(DialogueBaseNode node)
 {
     if (node is TextNode)
     {
         if (node is IParsable parsableNode)
         {
             // TODO create an interface (or interface API) that will display the node instead of a debug statement
             Debug.Log(ParseText(parsableNode.Text));
         }
     }
 }
Example #3
0
        public void Start()
        {
            if (!current)
            {
                // FIXME shouldn't there be an error when the current is already set? Or just always reset the node to entry
                // If current is not set (which is highly likely when you're starting a conversation) try to assign the
                // entry node defined by the dialogue graph to the current node. If it is still null, scream.
                if (!(current = dialogue.EntryNode))
                {
                    throw new InvalidOperationException("No entry point in dialogue graph");
                }
            }

            NextNode();
            Active = true;
        }