public override void UpdateAnimationObject(int KeyFrame)
        {
            //An Event is being executed.
            if (NextEvent != null)
            {
                UpdateAnimationSprite(KeyFrame);
            }

            VisibleAnimationObjectKeyFrame ActiveKeyFrame;
            VisibleAnimationObjectKeyFrame ActiveAnimationSpriteKeyFrame;

            if (DicAnimationKeyFrame.TryGetValue(KeyFrame, out ActiveAnimationSpriteKeyFrame))
            {
                ActiveKeyFrame = ActiveAnimationSpriteKeyFrame;
                //If that animation has already been used, skip it.
                if (ActiveKeyFrame.IsUsed)
                {
                    return;
                }

                int NextKeyFrame = ActiveKeyFrame.NextKeyFrame;
                OnNewKeyFrameAnimationSprite(ActiveKeyFrame);

                if (Owner != null)
                {
                    if (_ShootSecondaryWeapon)
                    {
                        Owner.Shoot(Position, _ShootSecondaryWeapon);
                    }
                    else if (OwnerWeapon != null)
                    {
                        int i = Owner.PrimaryWeapons.ActiveWeapons.IndexOf(OwnerWeapon);
                        Owner.Shoot(Position, OwnerWeapon, i);
                    }
                }

                if (DicAnimationKeyFrame.TryGetValue(NextKeyFrame, out ActiveAnimationSpriteKeyFrame))
                {
                    ActiveKeyFrame = ActiveAnimationSpriteKeyFrame;
                    if (ActiveKeyFrame.IsProgressive)
                    {
                        OnProgressiveNextKeyFrameAnimationSprite(ActiveKeyFrame, KeyFrame, NextKeyFrame);
                    }
                    else
                    {
                        NextEvent = null;
                    }
                }
            }
        }
Пример #2
0
            public void Evaluate(GameTime gameTime, object Input, out bool IsCompleted, out List <object> Result)
            {
                RobotAnimation CurrentRobot = Info.Owner;

                CurrentRobot.Shoot(CurrentRobot.AnimationOrigin.Position, false);

                Result      = new List <object>();
                IsCompleted = true;
            }