public float Update()
{
_currentTime = _currentTime + Time.deltaTime;
if (_currentTime > _duration)
{
_currentTime = _duration;
}
// how far into the time are we?
var percentageComplete = Math.InverseLerp(0, _duration, _currentTime);
// return a new morph value that represents progressing _currentTime thorugh things
return(_startValue + ((_targetValue - _startValue) * _easing(percentageComplete)));
}