Exemple #1
0
    void CheckForLineAdvance()
    {
        //don't immediately advance lines when the dialogue opens
        if (openedDialogueThisFrame)
        {
            openedDialogueThisFrame = false;
            return;
        }

        //this can happen if the player starts mashing C while the letterboxes are closing
        if (!DialogueOpen())
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            //update with the finished text and don't do anything else
            if (slowRendering)
            {
                CancelSlowRender();
                return;
            }

            if (currentBoss != null)
            {
                currentBoss.AdvanceLine();
            }
            else if (currentNPC != null)
            {
                currentNPC.AdvanceLine();
            }
            else if (currentSign != null)
            {
                CloseDialogue();
            }
        }
    }