Playables.PlayableOutputExtensions.PushNotification

Unity · Версия 2020.3 LTS · Scripting · PlayableOutputExtensions

Playables.PlayableOutputExtensions.PushNotification

Объявление

public static void PushNotification(U output, Playables.Playable origin, Playables.INotification notification, object context);

Параметры

output Результат отправки уведомления.
origin Исходный игровой объект уведомления.
notification Уведомление для отправки.
context Дополнительная информация о состоянии, когда уведомление было запущено.

Описание

Помещает уведомление в очередь для отправки через систему Playable.

using UnityEngine;
using UnityEngine.Playables;
class ExamplePlayableBehaviour : PlayableBehaviour
{
    private static readonly Notification s_BlendNotification = new Notification("BlendComplete");
    private float m_lastWeight = 0;

    public override void PrepareFrame(Playable playable, FrameData info)
    {
        if (m_lastWeight < 1 && info.effectiveWeight == 1)
        {
            info.output.PushNotification(playable, s_BlendNotification, m_lastWeight);
        }
        m_lastWeight = info.effectiveWeight;
    }
}

Обновлено 17 ноября 2026 г.