public void Play(Animation animation, bool forcePlayOnce, Action callback) { if (!forcePlay) { this.Reset(); this.forcePlay = forcePlayOnce; this.callback = callback; if (animation != null && (this.controller == null || this.controller.Animation != animation)) { if (controller != null) controller.FocusLost(); this.controller = new AnimationController(animation); if (!this.cachedAnimations.ContainsKey(animation) || animation.Resettable) { } else { this.controller = this.cachedAnimations[animation]; } if (!this.cachedAnimations.ContainsKey(animation)) { this.cachedAnimations.Add(animation, this.controller); } this.controller.LoopPassed += new EventHandler(onLoopPassed); } } }
public void Stop() { this.Reset(); this.controller = null; }