示例#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);
        }
示例#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);
        }
示例#3
0
 public bool CompareCurrentDialogue(DialogueTrigger dialogueTrigger)
 {
     return(dialogueTrigger == currentDialogueTarget);
 }
示例#4
0
 public void ExitState()
 {
     sentences.Clear();
     isTriggered           = false;
     currentDialogueTarget = null;
 }