public static void Update() { if (_queue.Count != 0) { ShowNextDialogue(); } if (IsShowingDialogue) { _dialogueBox.Update(); if (GameWorld.GetPlayers()[0].IsSkipDialoguePressed() && !_skipDialogueButtonDown) { _skipDialogueButtonDown = true; Console.WriteLine("User is trying to skip dialogue."); _dialogueBox.SkipDialogue(); // If skypping the dialogue caused it to end. if (!_dialogueBox.IsActive) { OnDialogueEnd?.Invoke(-1); Update(); } } if (!GameWorld.GetPlayers()[0].IsSkipDialoguePressed()) { _skipDialogueButtonDown = false; } } }
public void EndDialogue() { if (OnDialogueEnd != null) { OnDialogueEnd.Invoke(); } }
public void EndDialogue() { OnDialogueEnd?.Invoke(); this.gameObject.SetActive(false); dialogueText.text = ""; dialogueQueue.Clear(); isFinished = true; }
/// <summary> /// Exit the dialogue. /// </summary> private void OnExit() { _canvas.enabled = false; ResetListeners(); OnDialogueEnd?.Invoke(); CancelInvoke(); }
void EndDialogue() { if (dialoguePanel.activeSelf) { dialoguePanel.SetActive(false); sentences.Clear(); faceIndexes.Clear(); GameManager.instance.EnablePlayer(); onDialogueEndCallBack?.Invoke(); Time.timeScale = 1f; } }
//The player has clicked an option and the dialogue should now continue. //Which option is clicked is completely irrelevant rn public void Continue() { //advance the dialogue to the next bit. if (!dialogue.Advance(out Dialogue.DialogueSnippet snippet)) { //TODO: handle the dialogue ending. npcGroup.DOFade(0, 1).PlayForward(); //TODO: OnComplete => free player so they can move again. OnDialogueEnd?.Invoke(); //gameObject.SetActive(false); return; } ShowDialogue(snippet); }
public void Hide() { if (OnDialogueEnd != null) { OnDialogueEnd.Invoke(); } for (int i = 0; i < transform.childCount; i++) { if (transform.GetChild(i).GetType() != typeof(Button)) { transform.GetChild(i).gameObject.SetActive(false); } } }
void EndDialog(VD.NodeData data) { VD.OnNodeChange -= UpdateNode; VD.OnEnd -= EndDialog; VD.EndDialogue(); //Third most important method when using VIDE dialogueMenu.gameObject.SetActive(false); if (OnDialogueEnd != null) { OnDialogueEnd.Invoke(); } }
private void DoDialogueEndSequence() { var sequence = DOTween.Sequence(); //start by displaying the text. npcText.text = ""; float textDuration = (float)dialogue.OutOfDialogueText.Length / textSpeed; sequence.Append(npcGroup.DOFade(1, 0.5f).OnComplete(() => npcAudioSource.PlayOneShot(npcVoiceClip))); sequence.Append(DOTween.To(() => npcText.text, x => npcText.text = x, dialogue.OutOfDialogueText, textDuration)); //after a 2s delay, fade out what the npc is saying. sequence.Append(npcGroup.DOFade(0, 1).SetDelay(2f).OnComplete(() => OnDialogueEnd?.Invoke())); //TODO: OnComplete => free player so they can move again. //start the sequence. sequence.PlayForward(); }
public void EndDialogue() { dialogueBox.SetActive(false); dialogueText.text = ""; titleText.text = ""; StopAllCoroutines(); currentLine = null; isActive = false; if(pauseDuringDialogue) Time.timeScale = 1f; OnDialogueEnd?.Invoke(); }
void EmitDialogueEnd(Dialogue dialogue) { m_OnDialogueEnd.Invoke(dialogue); if (OnDialogueEnd != null) { OnDialogueEnd.Invoke(this, new DialogueEventArgs() { dialogue = dialogue }); } foreach (DialogueHandler dialogueHandler in m_dialogueHandlers) { dialogueHandler.HandleDialogueEnd(dialogue); } }
/// <summary>Returns an enumerator that waits for the dialogue to finish, resseting it when it has</summary> private IEnumerator DialogueRoutine(Dialogue dialogue, Action onFinish = null) { IsHoldingDialogue = true; backDrop.enabled = true; dialogue.SetupDisplay(leftCharacterDisplay, rightCharacterDisplay); yield return(SetupDialogue()); yield return(dialogue.Routine()); dialogue.Restore(); onFinish?.Invoke(); ResetDisplayPositions(); CheckForDeque(); OnDialogueEnd?.Invoke(); }
/// <summary> /// This method is called automatically once the dialogue line queue is empty, but it can be called to end the dialogue abruptly. /// calls the OnDialogueEnd event, unpauses the game (if the setting is on) and disables the dialogue box. /// </summary> public void EndDialogue() { dialogueBox.gameObject.SetActive(false); dialogueText.text = ""; if (titleText) { titleText.text = ""; } StopAllCoroutines(); currentLine = null; isActive = false; if (pauseDuringDialogue) { Time.timeScale = 1f; } OnDialogueEnd?.Invoke(); // If an agent or movable was blocked, sets them free if (agent) { // Input cooldown is needed because it uses the same "Interactable" button agent.InputCooldown(); agent.canInteract = true; } if (movingAgent) { FinalInferno.CharacterOW.PartyCanMove = true; //movingAgent.CanMove = true; } agent = null; movingAgent = null; // Triggers dialogue AfterDialogue method dialogue.AfterDialogue(); }
public virtual void ExecuteOnDialogueEnd() { OnDialogueEnd.Invoke(); }
public override void SelectNode(GameObject user) { OnDialogueEnd?.Invoke(messages, user); }
private void EndDialogue() { OnDialogueEnd?.Invoke(); dialoguePanel.gameObject.SetActive(false); }
/// <summary> /// Exit out of the current passage. /// Can be used to forcibly exit out of a running, incompleted passage. /// </summary> public static void Exit() { isRunning = false; OnDialogueEnd.Invoke(); }