change the UI Panel from multi-panels

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
danistmein
Posts: 2
Joined: Thu Jul 08, 2021 12:06 am

change the UI Panel from multi-panels

Post 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!
Attachments
Untitled.png
Untitled.png (9.4 KiB) Viewed 231 times
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: change the UI Panel from multi-panels

Post 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.
danistmein
Posts: 2
Joined: Thu Jul 08, 2021 12:06 am

Re: change the UI Panel from multi-panels

Post 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!
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: change the UI Panel from multi-panels

Post by Tony Li »

Sounds good! Glad to help.
Post Reply