Page 1 of 1

Tutorials for building a Dialogue UI

Posted: Fri Mar 15, 2024 4:54 pm
by dmitrybond
Hey folks,

I'm just learning the Dialogue UI and the question I have is related to building/customizing the code that links together the Dialogue UI logic and how it is represented in the Scene.

Right now I feel like I'm throwing a Dialogue Manager, attaching canvas elements and then everything happens automagically - but I don't understand what is happening under the hood and so I can't add one more "adapter" to support Nova UI or UI Toolkit or anything else.

To learn how to do that, I want to do an exercise for myself and build something ultra simple:
* When someone says something in a Dialog, I just want to do "Debug.log(" the name of who said it + the subtitle
* When I press numbers 1-5 on keyboard, it selects the corresponding reply, if currently the replies are shown

How can I do this? Where do I start? Is there some kind of tutorial or examples?

Thanks!

Re: Tutorials for building a Dialogue UI

Posted: Fri Mar 15, 2024 8:22 pm
by Tony Li
Hi,

Dialogue UIs just need to implement a few methods in a C# interface called IDialogueUI.

To get an idea of how the StandardDialogueUI scripts implement IDialogueUI, see the Dialogue UI Tutorial Videos.

Then, if you want to use Nova or UITK, duplicate the starter template script TemplateDialogueUI.cs, move your copy into your own scripts folder, rename it, and add your code (e.g., Debug.Log() calls) where the comments indicate. Then add the script to a GameObject and assign the GameObject to the Dialogue Manager's Display Settings > Dialogue UI field.