Set different Dialogue UI from script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
olakehs
Posts: 7
Joined: Mon Apr 19, 2021 2:28 am

Set different Dialogue UI from script

Post by olakehs »

Hi everyone

Might be a very basic question, but I've had a search around and read through the manual and can't seem to find it so thought I'd ask here. How do I set different Dialogue UI via script?

What I've currently got is an array currently attached to the DialogueManager which I place a bunch of different Dialogue UI I'd like to use (e.g. some are left-hand side, right-hand side, with/without background panel etc). The code I'm currently using which doesn't seem to work:

Code: Select all

DialogueManager.instance.SetDialoguePanel(DialogueManager.instance.GetComponent<MyDialogueList>().DialogueUIList[1]);
Thanks in advance for any advice
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: Set different Dialogue UI from script

Post by Tony Li »

Hi,

SetDialoguePanel() sets the current dialogue UI visible or invisible.

Use DialogueManager.UseDialogueUI() to set a different dialogue UI from script.
olakehs
Posts: 7
Joined: Mon Apr 19, 2021 2:28 am

Re: Set different Dialogue UI from script

Post by olakehs »

Thanks again Tony!

Also, if you don't mind, how would one change dialogue panels mid-convo? Is there something I need to place in the Script field at a node's Dialogue Entry?
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: Set different Dialogue UI from script

Post by Tony Li »

To use a different subtitle panel for a single node, use a [panel=#] markup tag in the node's Dialogue Text.

To switch permanently to a different panel, use the SetPanel() sequencer command in the node's Sequence field.
olakehs
Posts: 7
Joined: Mon Apr 19, 2021 2:28 am

Re: Set different Dialogue UI from script

Post by olakehs »

Thank you!!
Post Reply