PlayableDirector 组件已暂停时引发的事件。
在此事件中添加事件处理程序,以在 PlayableDirector 暂停时接收通知。处理程序还接收已暂停的 PlayableDirector。
在使用 PlayableBehaviour 时,此事件在 PlayableBehaviour.OnBehaviourPause 之前引发。
using UnityEngine; using UnityEngine.Playables;
public class PlayableDirectorCallbackExample : MonoBehaviour { public PlayableDirector director;
void OnEnable() { director.paused += OnPlayableDirectorPaused; }
void OnPlayableDirectorPaused(PlayableDirector aDirector) { if (director == aDirector) Debug.Log("PlayableDirector named " + aDirector.name + " is now paused."); }
void OnDisable() { director.paused -= OnPlayableDirectorPaused; } }