private static IAnimation Attach(IEntity entity, IAnimation animation) { var controller = entity.Controller <AnimationController>(); if (controller != null) { controller.Detach(); } var chain = new Animations.Chain(); if (animation != null) { chain.Add(animation); } controller = new AnimationController(chain); controller.AttachTo(entity); return(chain); }
private static IAnimation Attach(IEntity entity, IAnimation animation) { var controller = entity.Controller<AnimationController>(); if (controller != null) { controller.Detach(); } var chain = new Animations.Chain(); if (animation != null) { chain.Add(animation); } controller = new AnimationController(chain); controller.AttachTo(entity); return chain; }