예제 #1
0
    /// <summary>
    /// Calculate a Ease In from a pourcent
    /// </summary>
    /// <param name="linearStep">Pourcent on the ease</param>
    /// <param name="type">Easing Type</param>
    public static float EaseIn(float linearStep, EasingType type)
    {
        switch (type)
        {
        case EasingType.Step:
            return(Mathf.Round(linearStep));

        default:
        case EasingType.Linear:
            return(linearStep);

        case EasingType.Sine:
            return(Sine.EaseIn(linearStep));

        case EasingType.Quadratic:
            return(Power.EaseIn(linearStep, 2));

        case EasingType.Cubic:
            return(Power.EaseIn(linearStep, 3));

        case EasingType.Quartic:
            return(Power.EaseIn(linearStep, 4));

        case EasingType.Quintic:
            return(Power.EaseIn(linearStep, 5));

        case EasingType.Elastic:
            return(Elastic.EaseIn(linearStep));

        case EasingType.Bounce:
            return(Bounce.EaseIn(linearStep));

        case EasingType.Back:
            return(Back.EaseIn(linearStep));

        case EasingType.Expo:
            return(Expo.EaseIn(linearStep));

        case EasingType.Circ:
            return(Circ.EaseIn(linearStep));
        }
    }
예제 #2
0
    public static float EaseIn(float linearStep, EaseType type)
    {
        switch (type)
        {
        case EaseType.None:
            return(1);

        case EaseType.Linear:
            return(linearStep);

        case EaseType.Sine:
            return(Sine.EaseIn(linearStep));

        case EaseType.Quad:
            return(Power.EaseIn(linearStep, 2));

        case EaseType.Cubic:
            return(Power.EaseIn(linearStep, 3));

        case EaseType.Quartic:
            return(Power.EaseIn(linearStep, 4));

        case EaseType.Quintic:
            return(Power.EaseIn(linearStep, 5));

        case EaseType.Circ:
            return(Circ.EaseIn(linearStep));

        case EaseType.Bounce:
            return(Bounce.EaseIn(linearStep));

        case EaseType.Back:
            return(Back.EaseIn(linearStep));

        case EaseType.Elastic:
            return(Elastic.EaseIn(linearStep));
        }
        Debug.LogError("Um.");
        return(0);
    }
예제 #3
0
파일: Easing.cs 프로젝트: Slaktus/Tetra
        internal static float Ease(Type ease, float t, float duration)
        {
            switch (ease)
            {
            case Type.Linear:
                return(Linear.EaseNone(t, duration));

            case Type.BackIn:
                return(Back.EaseIn(t, duration));

            case Type.BackOut:
                return(Back.EaseOut(t, duration));

            case Type.BackInOut:
                return(Back.EaseInOut(t, duration));

            case Type.BounceIn:
                return(Bounce.EaseIn(t, duration));

            case Type.BounceOut:
                return(Bounce.EaseOut(t, duration));

            case Type.BounceInOut:
                return(Bounce.EaseInOut(t, duration));

            case Type.CircIn:
                return(Circular.EaseIn(t, duration));

            case Type.CircOut:
                return(Circular.EaseOut(t, duration));

            case Type.CircInOut:
                return(Circular.EaseInOut(t, duration));

            case Type.CubicIn:
                return(Cubic.EaseIn(t, duration));

            case Type.CubicOut:
                return(Cubic.EaseOut(t, duration));

            case Type.CubicInOut:
                return(Cubic.EaseInOut(t, duration));

            case Type.ElasticIn:
                return(Elastic.EaseIn(t, duration));

            case Type.ElasticOut:
                return(Elastic.EaseOut(t, duration));

            case Type.ElasticInOut:
                return(Elastic.EaseInOut(t, duration));

            case Type.Punch:
                return(Elastic.Punch(t, duration));

            case Type.ExpoIn:
                return(Exponential.EaseIn(t, duration));

            case Type.ExpoOut:
                return(Exponential.EaseOut(t, duration));

            case Type.ExpoInOut:
                return(Exponential.EaseInOut(t, duration));

            case Type.QuadIn:
                return(Quadratic.EaseIn(t, duration));

            case Type.QuadOut:
                return(Quadratic.EaseOut(t, duration));

            case Type.QuadInOut:
                return(Quadratic.EaseInOut(t, duration));

            case Type.QuartIn:
                return(Quartic.EaseIn(t, duration));

            case Type.QuartOut:
                return(Quartic.EaseOut(t, duration));

            case Type.QuartInOut:
                return(Quartic.EaseInOut(t, duration));

            case Type.QuintIn:
                return(Quintic.EaseIn(t, duration));

            case Type.QuintOut:
                return(Quintic.EaseOut(t, duration));

            case Type.QuintInOut:
                return(Quintic.EaseInOut(t, duration));

            case Type.SineIn:
                return(Sinusoidal.EaseIn(t, duration));

            case Type.SineOut:
                return(Sinusoidal.EaseOut(t, duration));

            case Type.SineInOut:
                return(Sinusoidal.EaseInOut(t, duration));

            default:
                return(Linear.EaseNone(t, duration));
            }
        }
예제 #4
0
 public override double Ease(double t, double b, double c, double d)
 {
     return(Back.EaseIn(t, b, c, d));
 }