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