Maby this would be a nob question. But what I would like implement is to quit the dialogue when the player is at the end of the Dialoguenode. Currently in the dialogue course to quit the dialogue, the player has to click on the click button in order to close the dialogue. I would like to make a condition if the player is at the end of the node, then quit the dialogue.
public void Quit()
{
currentDialogue = null;
currentNode = null;
isChoosing = false;
onConversationUpdated();
}
public void Next()
{
int numPlayerResponses = currentDialogue.GetPlayerChildren(currentNode).Count();
if (numPlayerResponses > 0)
{
isChoosing = true;
onConversationUpdated();
return;
}
DialogueNode[] children = currentDialogue.GetAIChildren(currentNode).ToArray();
int randomIndex = UnityEngine.Random.Range(0, children.Count());
currentNode = children[randomIndex];
onConversationUpdated();
if (children.Last())
{
Quit();
}
}
public bool HasNext()
{
return true;
//return currentDialogue.GetAllChildren(currentNode).Count() > 0;
}