public void Next(string nodeId = null) { if (WaitingForChoices || !IsActive) { return; } if (ExitScheduled) { OnChatComplete(); return; } ClearButtons(); ChatNode node = chatIterator.GoToNext(nodeId); if (node == null) { Debug.LogError("Chat quit unexpectedly. Couldn't find a node to display."); OnChatComplete(); return; } Debug.Log(node.Text); DialogueField.text = node.Text; ExitScheduled = node.IsLast; StopAllCoroutines(); StartCoroutine(TypeSentence(node)); }
public void NextSentence(string specificPoint = null) { if (WaitingForChoices || !IsActive) { return; } if (ExitScheduled) { OnChatComplete(); return; } NextButton.SetActive(false); if (ButtonContainer.transform.childCount > 0) { foreach (Transform child in ButtonContainer.transform) { Destroy(child.gameObject); } } ChatNode node = chatIterator.GoToNext(specificPoint); if (node == null) { Debug.LogError("Chat quit unexpectedly."); OnChatComplete(); return; } Debug.Log(node.Text); DialogueField.text = node.Text; ExitScheduled = node.IsLast; StopAllCoroutines(); StartCoroutine(TypeSentence(node)); }