Exemple #1
0
        // Add a transition from one Dialog node to another.
        public void AddTransition(string fromTag,
                                  string optionText,
                                  string toTag)
        {
            DialogNode fromNode = graph[fromTag];

            fromNode.AddDecision(optionText, toTag);
        }
Exemple #2
0
        //---------------------------------------------------------------------
        // Graph Building
        //---------------------------------------------------------------------

        public bool AddDialog(DialogNode node)
        {
            if (graph.Count == 0)
            {
                root = node;
            }
            graph[node.key] = node;
            return(true);
        }
Exemple #3
0
 private void SetCurrentNode(DialogNode node)
 {
     currentDialogNode = node;
     snippets.Clear();
     foreach (Sentence s in currentDialogNode.snippets)
     {
         snippets.Enqueue(s);
     }
 }
Exemple #4
0
        //---------------------------------------------------------------------
        // Constructor(s)
        //---------------------------------------------------------------------
        public void Awake()
        {
            if (file == "")
            {
                graph = new Dictionary <string, DialogNode>();
                foreach (DialogNode n in nodes)
                {
                    graph.Add(n.key, n);
                }

                if (nodes.Length > 0)
                {
                    root = nodes[0];
                }
            }
        }
Exemple #5
0
 public DialogNode MakeDecision(Decision decision)
 {
     current = graph[decision.destinationTag];
     return(current);
 }
Exemple #6
0
 public DialogNode StartDialog()
 {
     current = root;
     PerformStartEvents();
     return(root);
 }