static public float ElasticInOut(AnimationEasing easing, float time) { if (time <= 0.5f) { return easing.In(time * 2f) / 2f; } else { return (easing.Out((time - 0.5f) * 2f) / 2f) + 0.5f; } }
// Get easing with correct type public float GetEasing(float time) { if (easingType == EasingType.In) { return easing.In(time); } else if (easingType == EasingType.Out) { return easing.Out(time); } else if (easingType == EasingType.InOut) { return easing.InOut(time); } return 0; }
static public float InOut(AnimationEasing eas, float time) { if (time <= 0.5f) { return(eas.In(time * 2) / 2); } else { return((eas.Out((time - 0.5f) * 2) / 2) + 0.5f); } }
public static float InOut(AnimationEasing eas, float time) { if (time <= 0.5f) return eas.In(time * 2) / 2; else return (eas.Out((time - 0.5f) * 2) / 2) + 0.5f; }