Exemple #1
0
        public static float EaseIn(double linearStep, EasingType type)
        {
            switch (type)
            {
            case EasingType.Step:
                return(linearStep < 0.5 ? 0 : 1);

            case EasingType.Linear:
                return((float)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));
            }
            throw new NotImplementedException();
        }
Exemple #2
0
        public static float EaseIn(double linearStep, EasingType type)
        {
            switch (type)
            {
            case EasingType.Step:
                return(linearStep < 0.5 ? 0 : 1);

            case EasingType.Linear:
                return((float)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));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, "Unknown EasingType");
            }
        }
    /// <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));
        }
    }
Exemple #4
0
        public static float EaseIn(double linearStep, EasingType type)
        {
            switch (type)
            {
            case EasingType.Step: return(linearStep < 0.5 ? 0 : 1);

            case EasingType.Linear: return((float)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));

            default: return((float)linearStep);
            }
        }
Exemple #5
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);
    }
Exemple #6
0
 public override double Ease(double t, double b, double c, double d)
 {
     return(Sine.EaseIn(t, b, c, d));
 }