Page 1 of 1

Skip/Pause the Conversation

Posted: Thu Sep 03, 2015 10:39 am
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.

Re: Skip/Pause the Conversation

Posted: Thu Sep 03, 2015 8:15 pm
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.