Page 1 of 1

change the UI Panel from multi-panels

Posted: Thu Jul 08, 2021 12:20 am
by danistmein
Hi pixel, this asset is great. Everything works fine.

I have 2 Dialogue Ui in my scene, the main panel and the small one, like this the attachment. I want to switch the dialogue UI at runtime. How can I achieve this? Thanks!

Re: change the UI Panel from multi-panels

Posted: Thu Jul 08, 2021 8:47 am
by Tony Li
Hi,

That image looks like it would work well as two separate subtitle panels in the same dialogue UI. For a somewhat similar example, examine the Basic Standard Dialogue UI. It has two separate subtitle panels: NPC Subtitle Panel and PC Subtitle Panel.

If it would work in your case to implement them as two subtitle panels in the same dialogue UI, assign both to the StandardDialogueUI component's Conversation UI Elements > Subtitle Panels list. Each will have an element number (0, 1, etc.).

There are three ways to tell a subtitle to use a specific subtitle panel:
  • Add a Dialogue Actor component to a participating character's GameObject, and set its Dialogue UI Settings > Subtitle Panel Number. That participant will use the specified panel.
  • Or add a [panel=#] markup tag to a dialogue entry node's text to use a panel for that node.
  • Or use the SetPanel() sequencer command to tell an actor to use a panel for the remainder of the conversation.
A fourth way is to manually call DialogueManager.standardDialogueUI.OverrideActorPanel() in C#.

There are also corresponding ways to specify which response menu panel to use.

---

If you can't use separate subtitle panels in the same dialogue UI for some reason, then set up the panels in separate dialogue UIs (i.e., with separate StandardDialogueUI components). Assign the default dialogue UI to the Dialogue Manager GameObject's Display Settings > Dialogue UI field. When you want to use the other dialogue UI, add an Override Dialogue UI component to a character's GameObject, and assign the other dialogue UI to it. Conversations involving that character will use the other UI.

Re: change the UI Panel from multi-panels

Posted: Thu Jul 08, 2021 10:44 am
by danistmein
thanks for replying!
I exactly want the separate 2 Dialogue UI. Meanwhile, I can change the Dialogue Ui in the code. I will try the Override Dialogue UI Component now!

Re: change the UI Panel from multi-panels

Posted: Thu Jul 08, 2021 10:54 am
by Tony Li
Sounds good! Glad to help.