Пример #1
0
        public override void OnUpdate(float deltaTime)
        {
            if (entity.State != EntityState.Dying)
            {
                return;
            }

            var evt = AnimationEvent.Play(entity.ID); // TODO: Start Death Animation explicitly, not just any animation

            evt.ResetOnStop = false;
            eventManager.Queue(evt);
        }
        public override void OnUpdate(float deltaTime)
        {
            Vector2D atBoundary = entity[SpatialBehavior.Key_AtBoundary];

            if (atBoundary.X < 0 || atBoundary.X > 0 || atBoundary.Y < 0 || atBoundary.Y > 0)
            {
                eventManager.Queue(AiUpdateMovementEvent.AtBorder(entity.ID, atBoundary));
            }

            elapsedTime += deltaTime;
            if (elapsedTime >= timeToNextIdleAnimation)
            {
                elapsedTime             = 0.0f;
                timeToNextIdleAnimation = getTimeToNextIdleAnimation();

                eventManager.Queue(AnimationEvent.Play(entity.ID));
            }
        }
 private void startAnimation()
 {
     eventManager.Queue(AnimationEvent.Play(entity.ID));
 }