Example #1
0
 public virtual void Dispose()
 {
     mActive       = false;
     mKill         = true;
     mOnBeginPlay  = mOnComplete = mOnKill = mOnLoopComplete = null;
     mEaseFunction = null;
     mEaseCurve    = null;
 }
Example #2
0
 /// <summary>
 /// 安全回调函数
 /// </summary>
 /// <param name="callback"></param>
 /// <returns></returns>
 public bool OnTweenCallback(ActionTweenCallback callback)
 {
     if (ActionComponent.Instance.Config.UseSafetyMode)
     {
         try
         {
             callback();
         }
         catch (Exception e)
         {
             LOG.LogError("An error inside a tween callback was silently taken care of > " + e.Message + "\n\n" + e.StackTrace + "\n\n");
             return(false); // Callback error
         }
     }
     else
     {
         callback();
     }
     return(true);
 }
Example #3
0
 /// <summary>
 /// 每次Loop完回调一次,最后一次循环不会触发此函数,直接触发OnComplete函数
 /// </summary>
 /// <param name="tween"></param>
 /// <param name="callback"></param>
 /// <returns></returns>
 public static ActionTween SetLoopCompleteCallback(this ActionTween tween, ActionTweenCallback callback)
 {
     tween.mOnLoopComplete = callback;
     return(tween);
 }
Example #4
0
 /// <summary>
 /// 每帧更新的时候调用,尽量不要在这个函数内调用过度消耗性能的方法
 /// </summary>
 /// <param name="tween"></param>
 /// <param name="callback"></param>
 /// <returns></returns>
 public static ActionTween SetStepUpdateCallback(this ActionTween tween, ActionTweenCallback callback)
 {
     tween.mOnStepUpdate = callback;
     return(tween);
 }
Example #5
0
 /// <summary>
 /// 动画被杀死时回调
 /// </summary>
 /// <param name="tween"></param>
 /// <param name="callback"></param>
 /// <returns></returns>
 public static ActionTween SetKillCallback(this ActionTween tween, ActionTweenCallback callback)
 {
     tween.mOnKill = callback;
     return(tween);
 }
Example #6
0
 /// <summary>
 /// 动画开始的时候回调函数
 /// </summary>
 /// <param name="tween"></param>
 /// <param name="callback"></param>
 /// <returns></returns>
 public static ActionTween SetBeginPlayCallback(this ActionTween tween, ActionTweenCallback callback)
 {
     tween.mOnBeginPlay = callback;
     return(tween);
 }