Пример #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);
        }
Пример #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;
        }