Checking if Dialogue UI is Current Dialogue UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Voltage3000
Posts: 21
Joined: Mon Nov 27, 2023 8:28 pm

Checking if Dialogue UI is Current Dialogue UI

Post by Voltage3000 »

Hi Tony, we are currently crunching to try and get a new build out in time for Tribeca late submissions, so I'm setting up a system where we can easily switch between different dialogue templates for different fx.

It mostly works. However, I have some templates that have things like pop in animations subscribed to conversation start and stop dialogue events. This causes them to pop on screen even when they are not the current DialougeUI

I'm trying to set up a guard clause to prevent this from happening when they are not the active dialogue
GuardClause.JPG
GuardClause.JPG (43.51 KiB) Viewed 701 times
Is there a good way to implement what I'm trying to do here (unsuccessfully)?
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Checking if Dialogue UI is Current Dialogue UI

Post by Tony Li »

Hi,

Are you using entirely different dialogue UIs?

If so, you can check DialogueManager.standardDialogueUI. But perhaps the dialogue UI itself should be taking care of its pop-in animations.

If the dialogue UI is part of the Dialogue Manager's hierarchy, it will get OnConversationStart(Transform) and OnConversationEnd(Transform) messages. Otherwise you can hook into the C# events DialogueManager.instance.conversationStarted and conversationEnded. Or override the StandardDialogueUI class's Open() and Close() method to do your extra animation.
Voltage3000
Posts: 21
Joined: Mon Nov 27, 2023 8:28 pm

Re: Checking if Dialogue UI is Current Dialogue UI

Post by Voltage3000 »

Hi Tony, we are using entirely separate UI for different FX throughout the game. Your suggestion was what I was looking for, although in turned out I had checked "Don't Deactivate Main Panel" for some reason. I unchecked it and now it is never visible when its not being used, so problem solved.
Post Reply