Exemple #1
0
 public void OnEnter()
 {
     _curAnim = Const.ANIMATION.IDLE;
     _fsm.animationFinished += OnAnimationFinished;
     _animState              = new AnimStateModel(_fsm.animStateObj);
     _animState.Subscribe(OnAnimStateChanged);
 }
Exemple #2
0
        public PlayerFSM(PlayerPres player, AnimStateObject animObj, CharacterObject charObj) : base()
        {
            this.player     = player;
            _character      = new CharacterModel(charObj);
            _playerRotation = _character.Rotation;

            _animState = new AnimStateModel(animObj);
            _animState.Subscribe(OnAnimStateChanged);

            _inputSetting = InputSettingsModel.Get();
            if (_inputSetting == null)
            {
                Logger.Error("obj not found");
            }

            AddState(new StateAttack(STATE.ATTACK.ToString(), this, 40));
            AddState(new StateMovement(STATE.WALK.ToString(), this, 50));
            AddState(new StateIdle(STATE.IDLE.ToString(), this, 1000));

            ChangeState(STATE.IDLE);
        }
Exemple #3
0
 public AnimController(Animator animator, AnimStateObject obj)
 {
     _animator  = animator;
     _animState = new AnimStateModel(obj);
     _animState.Subscribe(OnAnimStateChanged);
 }