public void DisplayNextScentence(string choiceName)
 {
     waitForChoice      = false;
     currentTextElement = currentTextElement.nextTexts[currentTextElement.choiceTexts.FindIndex(i => i == choiceName)];
     HideChoices();
     DisplayNextScentence();
 }
        public void DisplayNextScentence()
        {
            if (currentSentence != "")
            {
                stopTyping = true;
                return;
            }

            if (waitForChoice)
            {
                return;
            }

            if (currentTextElement == null)
            {
                EndDialogue();
                return;
            }

            if (currentTextElement.italic)
            {
                dialogueText.fontStyle = FontStyle.Italic;
            }
            else
            {
                dialogueText.fontStyle = FontStyle.Normal;
            }
            stopTyping = true;
            StartCoroutine(TypeSentence(currentTextElement.text));
            if (nameText.text != currentTextElement.name)
            {
                StartCoroutine(ChangeName());
            }

            int countNext = currentTextElement.nextTexts.Count;

            if (countNext < 1)
            {
                currentTextElement = null;
            }
            else if (countNext == 1)
            {
                currentTextElement = currentTextElement.nextTexts[0];
            }
            else
            {
                ShowChoices();
                waitForChoice = true;
            }
        }
        public void StartDialogue(FalseTruth.Dialogue dialogue, bool unlockedMouse)
        {
            this.unlockedMouse = unlockedMouse;
            finished           = false;
            dialogueOutput     = -1;

            if (unlockedMouse)
            {
                FalseTruth.GameController.UnlockMouse();
            }
            else
            {
                FalseTruth.GameController.LockMouse();
            }

            animator.SetBool("IsOpen", true);

            currentTextElement = dialogue.firstText;

            DisplayNextScentence();
        }