public virtual void Destroy() { if (animations.Count > 0) { currentAnimation.Pause(); currentAnimation = null; foreach (var a in animations) { var component = a as IComponent; if (component != null) { component.Enabled = false; a.Owner.Context.RemoveComponent(component); } } animations.Clear(); if (controller != null) { controller.Destroy(); } } }
public override void Update() { Context.InputSystem .IsKeyDown(Keys.D1, () => ToogleAnimation(controller1)) .IsKeyDown(Keys.D2, () => ToogleAnimation(controller2)) .IsKeyDown(Keys.D3, () => { ToogleAnimation(controller1); ToogleAnimation(controller2); }) .IsKeyDown(Keys.D0, () => { controller1.Destroy(); controller2.Destroy(); }) .IsKeyDown(Keys.D7, () => AnimationPipelineController.PauseAll()) .IsKeyDown(Keys.D8, () => AnimationPipelineController.ResumeAll()) .IsKeyDown(Keys.D9, () => AnimationPipelineController.DestroyAll()); }