public EaseAinmationDrive(float maxTime, Vector3 startPos, Vector3 overPos, EaseActionMethod easeType) { this.maxTime = maxTime; this.easeType = easeType; startVector = startPos; overVector = overPos; }
/// <summary> /// 初始化动画事件 /// </summary> /// <param name="maxTime">最大时间</param> /// <param name="startNum">初始倍率</param> /// <param name="overNum">结束倍率</param> /// <param name="easeType">缓动函数类型</param> public EaseAinmationDrive(float maxTime, float startNum, float overNum, EaseActionMethod easeType) { this.maxTime = maxTime; this.overNum = overNum; this.startNum = startNum; this.easeType = easeType; startVector = Vector3.one * startNum; overVector = Vector3.one * overNum; }
public static float GetEaseAction(EaseActionMethod ease_type, float x) { switch (ease_type) { case EaseActionMethod.BackEaseIn: return(BackEaseIn(x, 0, 1, 1)); case EaseActionMethod.BackEaseOut: return(BackEaseOut(x, 0, 1, 1)); case EaseActionMethod.BounceEaseOut: return(BounceEaseOut(x, 0, 1, 1)); case EaseActionMethod.Linear: return(Linear(x, 0, 1, 1)); case EaseActionMethod.SineEaseIn: return(SineEaseIn(x, 0, 1, 1)); case EaseActionMethod.SineEaseInOut: return(SineEaseInOut(x, 0, 1, 1)); case EaseActionMethod.SineEaseOut: return(SineEaseOut(x, 0, 1, 1)); case EaseActionMethod.CubicEaseIn: return(CubicEaseIn(x, 0, 1, 1)); case EaseActionMethod.CubicEaseInOut: return(CubicEaseInOut(x, 0, 1, 1)); case EaseActionMethod.CubicEaseOut: return(CubicEaseOut(x, 0, 1, 1)); default: return(x); } }
public static float GetEaseAction(EaseActionMethod ease_type, float x) { switch (ease_type) { case EaseActionMethod.InBack: return(InBack(0, 1, x)); case EaseActionMethod.InBounce: return(InBounce(0, 1, x)); case EaseActionMethod.InCirc: return(InCirc(0, 1, x)); case EaseActionMethod.InCubic: return(InCubic(0, 1, x)); case EaseActionMethod.InElastic: return(InElastic(0, 1, x)); case EaseActionMethod.InExpo: return(InExpo(0, 1, x)); case EaseActionMethod.InOutBack: return(InOutBack(0, 1, x)); case EaseActionMethod.InOutBounce: return(InOutBounce(0, 1, x)); case EaseActionMethod.InOutCirc: return(InOutCirc(0, 1, x)); case EaseActionMethod.InOutCubic: return(InOutCubic(0, 1, x)); case EaseActionMethod.InOutElastic: return(InOutElastic(0, 1, x)); case EaseActionMethod.InOutExpo: return(InOutExpo(0, 1, x)); case EaseActionMethod.InOutQuad: return(InOutQuad(0, 1, x)); case EaseActionMethod.InOutQuart: return(InOutQuart(0, 1, x)); case EaseActionMethod.InOutQuint: return(InOutQuint(0, 1, x)); case EaseActionMethod.InOutSine: return(InOutSine(0, 1, x)); case EaseActionMethod.InQuad: return(InQuad(0, 1, x)); case EaseActionMethod.InQuart: return(InQuart(0, 1, x)); case EaseActionMethod.InQuint: return(InQuint(0, 1, x)); case EaseActionMethod.InSine: return(InSine(0, 1, x)); case EaseActionMethod.Linear: return(Linear(0, 1, x)); case EaseActionMethod.OutBack: return(OutBack(0, 1, x)); case EaseActionMethod.OutBounce: return(OutBounce(0, 1, x)); case EaseActionMethod.OutCirc: return(OutCirc(0, 1, x)); case EaseActionMethod.OutCubic: return(OutCubic(0, 1, x)); case EaseActionMethod.OutElastic: return(OutElastic(0, 1, x)); case EaseActionMethod.OutExpo: return(OutExpo(0, 1, x)); case EaseActionMethod.OutQuad: return(OutQuad(0, 1, x)); case EaseActionMethod.OutQuart: return(OutQuart(0, 1, x)); case EaseActionMethod.OutQuint: return(OutQuint(0, 1, x)); case EaseActionMethod.OutSine: return(OutSine(0, 1, x)); case EaseActionMethod.Spring: return(Spring(0, 1, x)); default: return(x); } }