Пример #1
0
    public ColorAnimator(IUpdaterOnDemand updater, float acceleration, float deceleration, float maxSpeed, float alphaAcceleration, float alphaDeceleration, float alphaMaxSpeed)
    {
        _updater = updater;

        _r = new FloatAnimator01(acceleration, deceleration, maxSpeed);
        _g = new FloatAnimator01(acceleration, deceleration, maxSpeed);
        _b = new FloatAnimator01(acceleration, deceleration, maxSpeed);
        _a = new FloatAnimator01(alphaAcceleration, alphaDeceleration, alphaMaxSpeed);

        Start();
    }
Пример #2
0
    public ColorAnimator(IUpdaterOnDemand updater, float transitionTime)
    {
        _transitionTime = transitionTime;
        _updater        = updater;
        var val = Mathf.Approximately(transitionTime, 0) ? Mathf.Infinity : (2 / (transitionTime * transitionTime));

        _r = new FloatAnimator01(val, val, float.MaxValue);
        _g = new FloatAnimator01(val, val, float.MaxValue);
        _b = new FloatAnimator01(val, val, float.MaxValue);
        _a = new FloatAnimator01(val, val, float.MaxValue);

        Start();
    }