public void Choice(int index) { if (index == 2 && npc.GetCurrentTree() == "TalkAgain") { index = 1; } if (npc.GetChoices().Length != 0) { npc.NextChoice(npc.GetChoices()[index]); //We make a choice out of the available choices based on the passed index. Display(); //We actually call this function on the left and right button's onclick functions } else { Progress(); } }
public void ShowOther() { //Currently showing text, wanting to show buttons if (showingText) { topText.text = dialogues.GetChoices()[0]; if (dialogues.GetChoices().Length > 1) { middleText.text = dialogues.GetChoices()[1]; } if (dialogues.GetChoices().Length > 2) { bottomText.text = dialogues.GetChoices()[2]; } if (dialogues.GetChoices().Length > 1) { middleText.transform.parent.gameObject.SetActive(true); } else { middleText.transform.parent.gameObject.SetActive(false); } if (dialogues.GetChoices().Length > 2) { bottomText.transform.parent.gameObject.SetActive(true); } else { bottomText.transform.parent.gameObject.SetActive(false); } } else { dialogueText.text = dialogues.GetCurrentDialogue(); } showingText = !showingText; buttonContainer.SetActive(!showingText); dialogueContainer.SetActive(showingText); }
private void Choice(int index) { dialogue.NextChoice(dialogue.GetChoices()[index]); Display(); }