Hello,
I'm wondering about the correct way to listen for OnConversationCancelled events. As far as I can tell it doesn't broadcast in the same way that OnConversationStart and OnConversationEnd do (ex: "InformParticipants"). Is that intended?
I would expect to be able to receive OnConversationCancelled in the same way as OnConversationEnd from a participant's monobehaviour.
Alternatively is there a way in OnConversationEnd to determine if a conversation was cancelled?
Thank you.
OnConversationCancelled
Re: OnConversationCancelled
Hi,
This table explains which GameObjects receive events such as OnConversationCancelled.
Currently OnConversationCancelled is sent to the Dialogue Manager and its children. After evaluating this further, in the next release (2.1.7.) I'll also make sure it's sent to both participants just like OnConversationEnd.
In the meantime, OnConversationCancelled is called before OnConversationEnd. You could add a script like this to the Dialogue Manager:
and check it on your participant character like this:
This table explains which GameObjects receive events such as OnConversationCancelled.
Currently OnConversationCancelled is sent to the Dialogue Manager and its children. After evaluating this further, in the next release (2.1.7.) I'll also make sure it's sent to both participants just like OnConversationEnd.
In the meantime, OnConversationCancelled is called before OnConversationEnd. You could add a script like this to the Dialogue Manager:
Code: Select all
public class CancelledMonitor : MonoBehaviour {
public static bool wasConversationCancelled;
void OnConversationStart(Transform actor) { wasConversationCancelled = false; }
void OnConversationCancelled(Transform actor) { wasConversationCancelled = true; }
}
Code: Select all
void OnConversationEnd(Transform actor) {
void OnConversationEnd(Transform actor) {
if (CancelledMonitor.wasConversationCancelled) {
Debug.Log("Conversation " + DialogueManager.lastConversationStarted + " ended by being cancelled!");
}
}
}
Re: OnConversationCancelled
Thanks for the clarification Tony! When do you expect 2.1.7 to be released?
Re: OnConversationCancelled
The target release date is this upcoming Friday, June 7.
Re: OnConversationCancelled
Version 2.1.7 has been released. It's available on the Pixel Crushers customer download site right now (PM me your Unity Asset Store invoice number if you need access), or you can wait 3-10 business days and download it from the Unity Asset Store.
Re: OnConversationCancelled
Great turn around time! Thank you so much
Re: OnConversationCancelled
Glad to help! Thanks for the suggestion.