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

参数

origin 发送通知的可播放项。
notification 收到的通知。
context 取决于通知类型的用户定义的数据。使用此参数可传递可能随每次调用而变化的必要信息。

描述

引发通知时调用的方法。

PlayableOutputExtensions.PushNotification 包含有关如何发送通知的示例。

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