Skip to content

Commit

Permalink
easing uses start/diff, lerp uses start/end
Browse files Browse the repository at this point in the history
What was meant for tick() is probably
		var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration );
		var value = Mathf.Lerp( _startValue, _startValue + _diffValue, easedTime );
		
but  the equivalent form
		var easedValue = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration );
		
is used elsewhere (FloatTweenProperty), and more succinct.
  • Loading branch information
charlesgriffiths committed Jul 11, 2016
1 parent c5ab4b5 commit 9f89c55
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ public override void prepareForUse()

public override void tick( float totalElapsedTime )
{
var easedTime = _easeFunction( totalElapsedTime, 0, 1, _ownerTween.duration );
var value = Mathf.Lerp( _startValue, _diffValue, easedTime );
var easedValue = _easeFunction( totalElapsedTime, _startValue, _diffValue, _ownerTween.duration );

_target.SetFloat( _materialPropertyName, value );
_target.SetFloat( _materialPropertyName, easedValue );
}

}

0 comments on commit 9f89c55

Please sign in to comment.