Page 1 of 1

OnConversationCancelled

Posted: Thu May 30, 2019 2:08 pm
by churchmf
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.

Re: OnConversationCancelled

Posted: Thu May 30, 2019 3:34 pm
by Tony Li
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:

Code: Select all

public class CancelledMonitor : MonoBehaviour {
    public static bool wasConversationCancelled;   
    void OnConversationStart(Transform actor) { wasConversationCancelled = false; } 
    void OnConversationCancelled(Transform actor) { wasConversationCancelled = true; } 
}
and check it on your participant character like this:

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

Posted: Fri May 31, 2019 9:58 am
by churchmf
Thanks for the clarification Tony! When do you expect 2.1.7 to be released?

Re: OnConversationCancelled

Posted: Sat Jun 01, 2019 8:11 am
by Tony Li
The target release date is this upcoming Friday, June 7.

Re: OnConversationCancelled

Posted: Sat Jun 08, 2019 5:24 pm
by Tony Li
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

Posted: Thu Jun 13, 2019 12:29 pm
by churchmf
Great turn around time! Thank you so much

Re: OnConversationCancelled

Posted: Fri Jun 14, 2019 8:43 am
by Tony Li
Glad to help! Thanks for the suggestion.