Ejemplo n.º 1
0
    public void Tick(float deltaTime, INumericValueStateSetter <float> value)
    {
        var maxIncrement = _value - _addedValue;
        var delta        = deltaTime + _offset;
        var increment    = Mathf.Min(_speed * delta, maxIncrement);

        _offset      = 0;
        _addedValue += increment;
        value.Increment(increment);
    }
Ejemplo n.º 2
0
    public void Tick(float deltaTime, INumericValueStateSetter <float> value)
    {
        _time += deltaTime;
        if (_time > _duration)
        {
            _time = _duration;
        }
        var normilizedDuration = _time / _duration;
        var mod          = _interpolation.Evaluate(normilizedDuration);
        var currentValue = mod * _value;
        var diff         = currentValue - _lastValue;

        value.Increment(diff);
        _lastValue = currentValue;
    }