Exemplo n.º 1
0
 void OptionStopConversation()
 {
     if (Input.GetKeyDown(KeyCode.X))
     {
         speechSelection = SpeechSelection.End;
     }
 }
Exemplo n.º 2
0
 void BackToStart()
 {
     if (textManager.speechInProgress == false)
     {
         speechSelection = SpeechSelection.Start;
     }
 }
Exemplo n.º 3
0
 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;
     }
 }
Exemplo n.º 4
0
    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();
                    }
                }
            }
        }
    }