INotificationReceiver.OnNotify

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public void OnNotify(Playables.Playable origin, Playables.INotification notification, object context);

Parameters

originThe playable that sent the notification.
notificationThe received notification.
contextUser defined data that depends on the type of notification. Uses this to pass necessary information that can change with each invocation.

Description

The method called when a notification is raised.

PlayableOutputExtensions.PushNotification contains an example on how to send a notification.

using UnityEngine;
using UnityEngine.Playables;
class NotificationLogger : MonoBehaviour, INotificationReceiver
{
    public void OnNotify(Playable origin, INotification notification, object context)
    {
        Debug.Log(notification.id);
    }
}

Did you find this page useful? Please give it a rating: