Esempio n. 1
0
        /// <summary>
        ///     This method is called automatically once the dialogue line queue is empty, but it can be called to end the dialogue abruptly.
        ///		calls the OnDialogueEnd event, unpauses the game (if the setting is on) and disables the dialogue box.
        /// </summary>
        public void EndDialogue()
        {
            // dialogueBox.SetActive(false);

            // dialogueText.text = "";
            // if(titleText){
            //  titleText.text = "";
            // }

            StopAllCoroutines();

            currentLine = null;
            isActive    = false;

            if (pauseDuringDialogue)
            {
                Time.timeScale = 1f;
            }

            OnDialogueEnd?.Invoke();
        }
Esempio n. 2
0
        /// <summary>
        ///     This method is called automatically once the dialogue line queue is empty, but it can be called to end the dialogue abruptly.
        ///		calls the OnDialogueEnd event, unpauses the game (if the setting is on) and disables the dialogue box.
        /// </summary>
        public void EndDialogue()
        {
            dialogueBox.gameObject.SetActive(false);

            dialogueText.text = "";
            if (titleText)
            {
                titleText.text = "";
            }

            StopAllCoroutines();

            currentLine = null;
            isActive    = false;

            if (pauseDuringDialogue)
            {
                Time.timeScale = 1f;
            }

            OnDialogueEnd?.Invoke();

            // If an agent or movable was blocked, sets them free
            if (agent)
            {
                // Input cooldown is needed because it uses the same "Interactable" button
                agent.InputCooldown();
                agent.canInteract = true;
            }
            if (movingAgent)
            {
                FinalInferno.CharacterOW.PartyCanMove = true;
                //movingAgent.CanMove = true;
            }
            agent       = null;
            movingAgent = null;

            // Triggers dialogue AfterDialogue method
            dialogue.AfterDialogue();
        }