// 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); }
//--------------------------------------------------------------------- // Graph Building //--------------------------------------------------------------------- public bool AddDialog(DialogNode node) { if (graph.Count == 0) { root = node; } graph[node.key] = node; return(true); }
private void SetCurrentNode(DialogNode node) { currentDialogNode = node; snippets.Clear(); foreach (Sentence s in currentDialogNode.snippets) { snippets.Enqueue(s); } }
//--------------------------------------------------------------------- // 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]; } } }
public DialogNode MakeDecision(Decision decision) { current = graph[decision.destinationTag]; return(current); }
public DialogNode StartDialog() { current = root; PerformStartEvents(); return(root); }