Пример #1
0
 public void OnEnter()
 {
     _curAnim = Const.ANIMATION.IDLE;
     _fsm.animationFinished += OnAnimationFinished;
     _animState              = new AnimStateModel(_fsm.animStateObj);
     _animState.Subscribe(OnAnimStateChanged);
 }
Пример #2
0
        private void AddAnimation(Const.ANIMATION key, string animation)
        {
            var success = _animController.AddAnimation((int)key, animation);

            if (!success)
            {
                Logger.Error("Cant add animation, key:" + key.ToString());
            }
        }
Пример #3
0
        private void Run(float moveX, float moveZ)
        {
            if (moveZ != 0)
            {
                _curAnim = moveZ > 0 ? Const.ANIMATION.RUN_FW : Const.ANIMATION.RUN_BW;
            }
            else if (moveX != 0)
            {
                _curAnim = moveX > 0 ? Const.ANIMATION.RUN_RIGHT: Const.ANIMATION.RUN_LEFT;
            }

            _character.MoveSpeed = Const.RunSpeed;
        }
Пример #4
0
        private void Walk(float moveX, float moveZ)
        {
            if (moveZ != 0)
            {
                _curAnim = moveZ > 0 ? Const.ANIMATION.WALK_FW : Const.ANIMATION.WALK_BW;
            }
            else if (moveX != 0)
            {
                _curAnim = moveX > 0 ? Const.ANIMATION.WALK_RIGHT: Const.ANIMATION.WALK_LEFT;
            }

            _character.MoveSpeed = Const.WalkSpeed;
        }
Пример #5
0
 public void ChangeAnimation(Const.ANIMATION key) => _animState.CurAnimation = (int)key;
Пример #6
0
 private void FireballSmall()
 {
     _isAnimationPlaying = true;
     _curAnim            = Const.ANIMATION.ATTACK_FIREBALL_SMALL;
 }
Пример #7
0
 private void FireballBig()
 {
     _isAnimationPlaying = true;
     _curAnim            = Const.ANIMATION.ATTACK_FIREBALL_BIG;
 }