예제 #1
0
파일: Attack.cs 프로젝트: nakoff/3dRpg
        public void OnUpdate(float dt)
        {
            var attack1        = Game.InputManager.GetValue(Game.InputManager.ACTIONS.ATTACK_LEFT);
            var attack2        = Game.InputManager.GetValue(Game.InputManager.ACTIONS.ATTACK_RIGHT);
            var spetial        = Game.InputManager.GetValue(Game.InputManager.ACTIONS.SPECIAL);
            var characterState = (PlayerFSM.STATE)_character.CurState;


            if (attack1 > 0 && !_isAnimationPlaying)
            {
                FireballBig();
            }
            else if (attack2 > 0 && !_isAnimationPlaying)
            {
                FireballSmall();
            }

            _fsm.ChangeAnimation(_curAnim);
            _fsm.PlayerRot(dt);

            if (_spellCharacter != null)
            {
                _spellCharacter.Position = _fsm.player.FistPosition;
            }
        }
예제 #2
0
파일: Movement.cs 프로젝트: nakoff/3dRpg
        public void OnUpdate(float dt)
        {
            var moveX  = Game.InputManager.GetValue(Game.InputManager.ACTIONS.MOVE_X);
            var moveZ  = Game.InputManager.GetValue(Game.InputManager.ACTIONS.MOVE_Z);
            var sprint = Game.InputManager.GetValue(Game.InputManager.ACTIONS.SPECIAL);

            if (sprint != 0)
            {
                Run(moveX, moveZ);
            }
            else
            {
                Walk(moveX, moveZ);
            }

            _fsm.ChangeAnimation(_curAnim);
            _fsm.PlayerMove(dt);
            _fsm.PlayerRot(dt);
        }
예제 #3
0
 public void OnEnter()
 {
     _fsm.ChangeAnimation(Const.ANIMATION.IDLE);
 }