Hello!
Is there a way to easily tap into DialogueSystemTrigger events via code?
I know you can set up events and assign Gameobjects, but I am looking to (for example), always hide the player UI when conversations start. Rather than assigning an action to every trigger to do that in every scene - is there a way I can tap into the OnConversationStart via script, so my UI knows that when that fires, it should always disable?
I'm trying to figure out what the intended way of interfacing with this is.
Tapping into DialogueSystem Events Globally from Code
Re: Tapping into DialogueSystem Events Globally from Code
Yes, add a Dialogue System Events component to your player. Configure the OnConversationStart() UnityEvent to hide the UI. Configure OnConversationEnd() to show it again. Your player should be the active conversation's actor or conversant for this to work. For more info on GameObject assignments, see: Character GameObject Assignments. For a video explanation, see 07:00 of the Interaction Tutorial.
Alternatively, hook into the C# events DialogueManager.instance.conversationStarted and conversationEnded.
Alternatively, hook into the C# events DialogueManager.instance.conversationStarted and conversationEnded.
Re: Tapping into DialogueSystem Events Globally from Code
Thank you! This was super helpful.