How to send UnityAction when some conversation ends

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
sentendo
Posts: 15
Joined: Sun Sep 29, 2019 1:38 pm

How to send UnityAction when some conversation ends

Post by sentendo »

Hello,

I would like to implement in my "Game Event System" some notification to send to the observers (for instance: the game manager) whenever a conversation ends.

I cannot use the "Dialogue System Events", because I need to specify an ID (string, for instance) to have a different reaction to different conversations.

What's the best approach to implement this?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to send UnityAction when some conversation ends

Post by Tony Li »

Hi,

If you use Dialogue System Events, your observers can check DialogueManager.lastConversationStarted to know what conversation ended.

Otherwise you can add an OnConversationEnd(Transform actor) method to a script on the Dialogue Manager and check DialogueManager.lastConversationStarted in that method.
ar4wy
Posts: 26
Joined: Fri Nov 15, 2019 10:16 pm

Re: How to send UnityAction when some conversation ends

Post by ar4wy »

Thanks so much for this! Works great!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to send UnityAction when some conversation ends

Post by Tony Li »

Glad to help!
sentendo
Posts: 15
Joined: Sun Sep 29, 2019 1:38 pm

Re: How to send UnityAction when some conversation ends

Post by sentendo »

perfect, thank you very much!
Post Reply