Skip/Pause the Conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jagermeister35
Posts: 6
Joined: Thu Jul 16, 2015 9:32 am

Skip/Pause the Conversation

Post by jagermeister35 »

Hi Tony!
Is there some way to pause the conversation? I need it for the Menu appearance. Whan player call menu all process need to be stoped.
And can I somehow skip the conversation (or exit it) ?
Thank you.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Skip/Pause the Conversation

Post by Tony Li »

Hi,

Yes. Set DialogueTime.IsPaused to pause the sequencer, typewriter effect, etc.:

Code: Select all

using PixelCrushers.DialogueSystem;
DialogueTime.IsPaused = true;
You'll probably also want to hide the UI. This depends on the GUI system you're using. If you're using legacy Unity GUI, set the GUIRoot's visible property false:

Code: Select all

(DialogueManager.DisplaySettings.dialogueUI as UnityDialogueUI).guiRoot.visible = false;
If you're using Unity UI, set the dialogue panel's CanvasGroup.alpha to 0:

Code: Select all

(DialogueManager.DisplaySettings.dialogueUI as UnityUIDialogueUI).dialogue.panel.GetComponent<CanvasGroup>().alpha = 0;
To exit a conversation, call DialogueManager.StopConversation(). You can read DialogueManager.CurrentConversationState to record the state of the conversation first if you want. Then you can resume at that point by calling DialogueManager.StartConversation and providing the entry ID to start at.
Post Reply