public virtual void Dispose() { mActive = false; mKill = true; mOnBeginPlay = mOnComplete = mOnKill = mOnLoopComplete = null; mEaseFunction = null; mEaseCurve = null; }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }