Page 1 of 1

How to change Dialogue UI in runtime

Posted: Wed Aug 18, 2021 3:25 am
by Jdedueass
Hi!

I'm trying to change the dialogue UI in runtime and I can't figure out how to do it by myself.

For context, the game I'm building has the default conversations with NPC's and a dialogue battle. Once the dialogue battle starts I would like to change the UI, and once it ends, change it back to the default UI for conversations.

I hope it's clear and thanks in advance!

Re: How to change Dialogue UI in runtime

Posted: Wed Aug 18, 2021 10:17 am
by Tony Li
Hi,

The easiest way is use a unique GameObject for the battle conversation's conversant -- for example, maybe a GameObject named BattleManager that's a child of the Dialogue Manager GameObject. Add an Override Dialogue UI component to this GameObject, and assign your battle UI. Conversations that involve this GameObject will use the battle UI instead of your default UI.

Alternatively, you can call DialogueManager.SetDialogueUI() in C# before starting the conversation.

Re: How to change Dialogue UI in runtime

Posted: Fri Aug 20, 2021 3:25 am
by Jdedueass
Thanks Tony! Surely it seems to be easier than I thought. I'll try it, thanks again.

Re: How to change Dialogue UI in runtime

Posted: Fri Aug 20, 2021 8:14 am
by Tony Li
Happy to help!