Esempio n. 1
0
        internal void StartDialogue(Dialogue dialogue, DialogueTrigger dialogueTrigger)
        {
            sentences.Clear();
            UIManager.uIManager.ChangeState(UIState.DIALOGUE);
            currentDialogueTarget = dialogueTrigger;
            isTriggered           = true;
            nameText.text         = loadedDialogue[dialogue.id][0];

            for (int i = 1; i < loadedDialogue[dialogue.id].dialogue.Length; i++)
            {
                sentences.Enqueue(loadedDialogue[dialogue.id][i]);
            }

            DisplayNextSentence(dialogueTrigger);
        }
Esempio n. 2
0
        public bool DisplayNextSentence(DialogueTrigger dialogueTrigger)
        {
            if (!isTriggered || dialogueTrigger != currentDialogueTarget)
            {
                return(false);
            }
            sfx.PlaySFX(0);
            if (sentences.Count == 0)
            {
                EndDialogue();
                return(false);
            }

            if (textTyping != null)
            {
                StopCoroutine(textTyping);
                textTyping = null;
            }
            textTyping = StartCoroutine(TypeSentence(sentences.Dequeue()));
            return(true);
        }
Esempio n. 3
0
 public bool CompareCurrentDialogue(DialogueTrigger dialogueTrigger)
 {
     return(dialogueTrigger == currentDialogueTarget);
 }
Esempio n. 4
0
 public void ExitState()
 {
     sentences.Clear();
     isTriggered           = false;
     currentDialogueTarget = null;
 }