Beispiel #1
0
 public void NextNode()
 {
     if (nextElement == null)
     {
         Debug.LogWarning("Conversation ended with null next element " + this);
         currentReader.EndConversation();
     }
     else if (nextElement.type == ConversationElementType.End)
     {
         currentReader.EndConversation();
     }
     else
     {
         ProcessNode(nextElement, currentReader);
         if (currentElement.next >= elements.Count)
         {
             Debug.LogError("Out of range next element");
         }
         else
         {
             nextElement = elements[currentElement.next];
         }
     }
 }
Beispiel #2
0
 public void StartTree(ConversationElement element, IConversationReader reader)
 {
     currentReader = reader;
     ProcessNode(element, reader);
     if (currentElement.next <= -1)
     {
         Debug.Log("Tree is one node long");
         currentReader.EndConversation();
     }
     else if (currentElement.next >= elements.Count)
     {
         Debug.LogError("Out of range next element");
     }
     else
     {
         nextElement = elements[currentElement.next];
     }
 }