using System; using Fort23.Core; using UnityEngine; namespace Utility.CTween { public static class CustomTweenEX { public enum CustomAnimationCurve { Line, InExpo } public static T SetEase(this T t, CustomAnimationCurve ease) where T : CustomTweener { switch (ease) { case CustomAnimationCurve.Line: t.AnimationCurve = CustomTweenManager.AnimationCurveLibrary.Line; break; case CustomAnimationCurve.InExpo: t.AnimationCurve = CustomTweenManager.AnimationCurveLibrary.InExpo; break; } return t; } public static T OnComplete(this T t, Action action) where T : CustomTweener { t.OnCompleteAction = action; return t; } public static T SetLoop(this T t, bool isLoop) where T : CustomTweener { t.IsLoop = isLoop; return t; } /// /// 注册变量改变事件 /// /// /// /// /// public static T RegValueChangeAction(this T t, Action action) where T : CustomTweener { action.Invoke(); return t; } public static T OnUpdate(this T t, Action action) where T : CustomTweener { t.OnUpdateAction += action; return t; } public static T OnUpdate(this T t, Action action) where T : CustomTweener { t.OnUpdateAndValueAction += action; return t; } } }