示例#1
0
文件: Attack.cs 项目: nakoff/3dRpg
 public void OnEnter()
 {
     _curAnim = Const.ANIMATION.IDLE;
     _fsm.animationFinished += OnAnimationFinished;
     _animState              = new AnimStateModel(_fsm.animStateObj);
     _animState.Subscribe(OnAnimStateChanged);
 }
示例#2
0
文件: PlayerFSM.cs 项目: nakoff/3dRpg
        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);
        }
示例#3
0
 public AnimController(Animator animator, AnimStateObject obj)
 {
     _animator  = animator;
     _animState = new AnimStateModel(obj);
     _animState.Subscribe(OnAnimStateChanged);
 }