// Close the dialogue screen private void CloseDialogue() { OnDialogueEnded?.Invoke(); SetAnimation(false); SetUpNextNode(); }
public void EndDialogue() { animator.SetBool("isOpen", false); playerController.EnableMovement(); playerController.EnableJumpingDialogClose(); OnDialogueEnded?.Invoke(this, EventArgs.Empty); }
public string NextReplique() { if (index < répliques.Length) { return(répliques[index++].repliqueText); } else { onDialogueEnded?.Invoke(); return(null); } }
protected virtual void EndDialogue() { if (!DialogueIsRunning) { return; } currentConversation.InvokeEndEvent(); currentPosition = -1; speakers = null; enabled = false; OnDialogueEnded?.Invoke(); }
private IEnumerator PlayDialogueTree(DialogueTree tree, Action OnSpecificDialogueEnded = null) { isInDialogue = true; canvas.enabled = true; timer?.Pause(); CharacterInfo answeringCharacter = tree.Characters[0]; while (tree != null) { yield return(StartCoroutine(lineVisualizer.PlayDialogueLines(tree.Lines, tree.Characters))); if (tree.Answers.Length > 1) { bool answerChosen = false; answerDisplay.ShowAnswers(tree.Answers, answeringCharacter, (nextTree) => { answerChosen = true; if (nextTree != null) { nextTree.SetCharacters(tree.characters); } tree = nextTree; }); while (!answerChosen) { yield return(null); } } else if (tree.Answers.Length == 1) { DialogueTree nextTree = tree.Answers[0].NextTree; nextTree.SetCharacters(tree.characters); tree = nextTree; } else { tree = null; } } canvas.enabled = false; isInDialogue = false; timer?.UnPause(); OnDialogueEnded?.Invoke(); OnCurrentDialogueEnded?.Invoke(); OnCurrentDialogueEnded = null; OnSpecificDialogueEnded?.Invoke(); }
private void CalculateVisemes() { if (HasDialogueFinished() == true) { if (isDialoguePlaying == true) { isDialoguePlaying = false; OnDialogueEnded?.Invoke(); } return; } else { isDialoguePlaying = true; if (AreAllBlendShapesZeroed() == false) { ZeroOutAllBlendShapes(); } if (dialogueAudioSource.isPlaying) { IncrementCurrentVisemeBlendShape(); } } }
void EndDialogue() { animator.SetBool("IsOpen", false); OnDialogueEnded?.Invoke(); }