void OptionStopConversation() { if (Input.GetKeyDown(KeyCode.X)) { speechSelection = SpeechSelection.End; } }
void BackToStart() { if (textManager.speechInProgress == false) { speechSelection = SpeechSelection.Start; } }
void CheckState() { if (textManager.speechInProgress == true && Input.GetKeyDown(KeyCode.Q)) { speechSelection = SpeechSelection.Left; } else if (textManager.speechInProgress == true && Input.GetKeyDown(KeyCode.E)) { speechSelection = SpeechSelection.Right; } }
void CurrentTree() { switch (speechSelection) { default: case SpeechSelection.Start: { StartConversation(); CheckState(); Debug.Log("Start Convo"); OptionStopConversation(); break; } case SpeechSelection.Left: { key = KeyCode.Q; LoadLeft(); StartConversation(); ContinueConversation(); playerDialogue.CloseDialog(true); if (textManager.currentSpeechIndex == npcAnswerTree.dailyScripts[gm.dayCount].speechGroup.Count) { speechSelection = SpeechSelection.End; } OptionStopConversation(); break; } case SpeechSelection.Right: { key = KeyCode.E; LoadRight(); StartConversation(); ContinueConversation(); playerDialogue.CloseDialog(false); if (textManager.currentSpeechIndex == npcAnswerTree.dailyScripts[gm.dayCount].speechGroup.Count) { speechSelection = SpeechSelection.End; } OptionStopConversation(); break; } case SpeechSelection.End: { //read end dialogue EndDialogue(); Debug.Log("EndConvo" + textManager.speechInProgress); BackToStart(); break; } } void ContinueConversation()/*itt a bibi*/ { if (textManager.speechInProgress == true && Input.GetKeyDown(key)) { if (key == KeyCode.Q) { textManager.SetSpeechNext(); if (textManager.playerSpeechInProgress == false) { textManager.StartPlayerLeftSpeech(playerAnswer); } else { textManager.SetPlayerLeftSpeechNext(); } } if (key == KeyCode.E) { textManager.SetSpeechNext(); if (textManager.playerSpeechInProgress == false) { textManager.StartPlayerRightSpeech(playerAnswer); } else { textManager.SetPlayerRightSpeechNext(); } } } } }