public void NextNode() { current = current.GetNextNode(); // TODO replace this with an event that an interface can react to DisplayNode(current); PeekNext(); }
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)); } } }
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; }