public static TimedAnimator <T> WhenFinished <T>(this TimedAnimator <T> animator, Action <TimedAnimator <T> > action) { return(new DelegateTimedAnimator <T>(t => { var res = animator.Animate(TimeSpan.FromMilliseconds(t * animator.TotalDuration.TotalMilliseconds)); if (animator.Finished) { action(animator); } return res; }, animator.TotalDuration, animator.StartValue, animator.AnimatorType)); }
public static TimedAnimator <T> Add <T>(this TimedAnimator <T> first, IAnimator <double> second) => new DelegateTimedAnimator <T>(input => first.Animate(second.Animate(input)), first.TotalDuration, first.CurrentValue, first.AnimatorType);
public override T Animate(double input) => _baseAnimator.Finished ? _NextAnimator.Animate(input * 2 - 1) : _baseAnimator.Animate(input * 2);