AssemblyCSharp.Ease.ElasticEaseInOut C# (CSharp) 메소드

ElasticEaseInOut() 공개 정적인 메소드

Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration.
public static ElasticEaseInOut ( double t, double b, double c, double d ) : double
t double Current time in seconds.
b double Starting value.
c double Final value.
d double Duration of animation.
리턴 double
        public static double ElasticEaseInOut(double t, double b, double c, double d)
        {
            if ((t /= d / 2) == 2)
            {
            return b + c;
            }

            var p = d * (.3 * 1.5);
            var s = p / 4;

            if (t < 1)
            {
            return -.5 * (c * Math.Pow(2, 10 * (t -= 1)) * Math.Sin((t * d - s) * (2 * Math.PI) / p)) + b;
            }
            return c * Math.Pow(2, -10 * (t -= 1)) * Math.Sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
        }