Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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;
        }