public override void Initialize() { this.animationTimer = new OneTimeTimer(); RunTime = 1; Paused = true; }
public float GetValue(float time, IAnimationTimer animationTimer, InterpolatorDelegate interpolator) { if (!this.keyframes.Any()) { return(0); } KeyValuePair <float, float> minTime = this.keyframes.First(); KeyValuePair <float, float> maxTime = this.keyframes.Last(); float startTime = StartingTime; time = startTime + AnimationTimer.Value(time, FinishingTime - startTime); if (time <= minTime.Key) { return(minTime.Value); } if (time >= maxTime.Key) { return(maxTime.Value); } KeyValuePair <float, float> prevTime = this.keyframes.First(kf => kf.Key >= time); KeyValuePair <float, float> succTime = this.keyframes.First(kf => kf.Key > prevTime.Value); float dt = succTime.Key - prevTime.Key; float t = (time - prevTime.Key) / dt; return(interpolator.Invoke(t, prevTime.Value, succTime.Value)); }
public Timeline(IAnimationTimer animationTimer, InterpolatorDelegate interpolator) { this.keyframes = new SortedDictionary <float, float>(); AnimationTimer = animationTimer; Interpolator = interpolator; }
public static IAnimationTimer CreateRef(this IAnimationTimer objectRef) => ((IAnimationTimer)objectRef.CreateRef(typeof(IAnimationTimer)));
internal void <.cctor> b__18_2(IAnimationTimer innerRefT, Delegate handler) { innerRefT.RenderingTooSlow -= ((RenderingTooSlowEventHandler)handler); }
internal void <.cctor> b__18_1(IAnimationTimer innerRefT, Delegate handler) { innerRefT.PreUpdate -= ((EventHandler)handler); }