public float Easing(float lim, float x, EasingID id)
    {
        float y = 0;

        switch (id)
        {
        case EasingID.Linear:
            y = Linear(lim, x);
            break;

        case EasingID.EaseInSine:
            y = EaseInSine(lim, x);
            break;

        case EasingID.EaseOutSine:
            y = EaseOutSine(lim, x);
            break;

        case EasingID.EaseInOutSine:
            y = EaseInOutSine(lim, x);
            break;
        }

        return(y);
    }
Example #2
0
    public ParticleInfo(float duration,
                        float length, float lengthRndRatio,
                        float defaultAng, float defaultAngleAmp,
                        float speed, float speedRndRatio, EasingID id,
                        float refractionAng, float refractAngleAmp, float refractionProb,
                        bool firstRefract, bool radUpdatable)
    {
        durationSec           = duration;
        moveLength            = length;
        lengthRandRatio       = lengthRndRatio;
        defaultAngle          = defaultAng;
        defaultAngleAmplitude = defaultAngleAmp;

        moveSpeed      = speed;
        speedRandRatio = speedRndRatio;
        easingID       = id;

        refractionAngle          = refractionAng;
        refractionAngleAmplitude = refractAngleAmp;
        refractionProbability    = refractionProb;

        canRefractFirst = firstRefract;
        canUpdateRad    = radUpdatable;
    }