/// Called when the dialogue system has finished running. /// <inheritdoc/> public override void DialogueComplete() { DialogueEnded?.Invoke(); // Hide the dialogue interface. if (dialogueContainer != null) { dialogueContainer.SetActive(false); } }
private void EndDialogue() { nextSentence.Disable(); if (animator) { animator.SetBool(OpenTextBox, false); } nextSentenceArrow.gameObject.SetActive(false); DialogueEnded?.Invoke(); }
// display the texts in the dialogueObj on the screen // if there's none, delete the dialogue // returns true if there are /// <summary> /// Get the next dialogue. If there's no more, destroy /// the dialogue UI object. /// </summary> /// <returns> /// true if there is a next dialogue. Else false. /// </returns> public bool NextDialogue() { try { DialogueStruct dialogueObj = dialogues[curScriptIndex++]; speechTxt.text = dialogueObj.speech; speakerTxt.text = dialogueObj.speaker; if (dialogueObj.speaker == "Help") { profilePic.sprite = Resources.Load <Sprite>($"CharacterPic/question_marks"); } else { profilePic.sprite = Resources.Load <Sprite>($"CharacterPic/{dialogueObj.speaker.ToLower()}"); } } catch (IndexOutOfRangeException) { Destroy(gameObject); DialogueEnded?.Invoke(this, args); return(false); } return(true); }
protected virtual void OnDialogueEnded() { DialogueEnded?.Invoke(); }