Beispiel #1
0
    IEnumerator DialogueWindow()
    {
        while (true)
        {
            // DIALOGUE SHOW
            if (Dialogue.Count > 0)
            {
                if (!dialogueOn)
                {
                    dialogueText.enabled = true;
                    dialogueOn           = true;

                    // Instantiate new lerp
                    if (Lerper != null)
                    {
                        StopCoroutine(Lerper);
                    }
                    Lerper = LerpTo(1.0f);
                    StartCoroutine(Lerper);
                }

                if (Dialogue[0].unSkippable)
                {
                    ClearContinueButton();
                }
                else
                {
                    ShowContinueButton();
                }
            }
            else
            {
                if (dialogueOn)
                {
                    dialogueText.enabled = false;
                    //dialogueBorder.enabled = false;
                    dialogueOn = false;
                    InteractionManager.BreakConversation();

                    // Instantiate new lerp
                    if (Lerper != null)
                    {
                        StopCoroutine(Lerper);
                    }
                    Lerper = LerpTo(0.0f);
                    StartCoroutine(Lerper);
                }
                ClearContinueButton();
            }
            yield return(new WaitForSecondsRealtime(0.1f));
        }
    }