private void Start()
 {
     animator.AddClipStartCallback(layerIndex, clipName, () =>
     {
         Debug.LogFormat("Clip \"{0}\": started", clipName);
     });
     animator.AddClipEndCallback(layerIndex, clipName, () =>
     {
         Debug.LogFormat("Clip \"{0}\": ended", clipName);
     });
     animator.AddClipCallback(layerIndex, clipName, ExampleTimelinePosition, () =>
     {
         Debug.LogFormat("Clip \"{0}\": callback at {1} seconds after start", clipName, ExampleTimelinePosition);
     });
 }
Ejemplo n.º 2
0
 private void AddProgressCallback()
 {
     animator.AddClipCallback(layerIndex, clipName, ExampleTimelinePosition, HandleClipProgressed);
 }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="animator"></param>
 /// <param name="clipName"></param>
 /// <param name="callback"></param>
 /// <param name="layerIndex"></param>
 /// <returns></returns>
 public static bool AddClipStartCallback(this Animator animator, string clipName, Action callback, int layerIndex = 0)
 {
     return(animator.AddClipCallback(clipName, 0.0f, callback, layerIndex));
 }
Ejemplo n.º 4
0
 public static void AddClipStartCallback(this Animator animator, int layerIndex, string clipName, Action callback)
 {
     animator.AddClipCallback(layerIndex, clipName, 0.0f, callback);
 }