コード例 #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
ファイル: PlayerPres.cs プロジェクト: nakoff/3dRpg
        public PlayerPres(IPlayerView view) : base(ENTITY_TYPE.PLAYER)
        {
            _character           = CharacterModel.Create(Type, Id);
            _character.MoveSpeed = 100;

            var collState          = InteractStateModel.Create(Type, Id);
            var interactController = new InteractController(collState.obj);

            _view = view;
            _view.interactController = interactController;
            _character.Position      = _view.Position;
            _view.Subscribe(OnViewChanged);

            _animState      = AnimStateModel.Create(Type, Id);
            _animController = _view.CreateAnimController(_animState.obj);

            AddAnimation(Const.ANIMATION.IDLE, "Standing Idle");
            AddAnimation(Const.ANIMATION.WALK_FW, "Standing Walk Forward");
            AddAnimation(Const.ANIMATION.WALK_BW, "Standing Walk Back");
            AddAnimation(Const.ANIMATION.WALK_LEFT, "Standing Walk Left");
            AddAnimation(Const.ANIMATION.WALK_RIGHT, "Standing Walk Right");
            AddAnimation(Const.ANIMATION.RUN_FW, "Standing Run Forward");
            AddAnimation(Const.ANIMATION.RUN_BW, "Standing Run Back");
            AddAnimation(Const.ANIMATION.RUN_LEFT, "Standing Run Left");
            AddAnimation(Const.ANIMATION.RUN_RIGHT, "Standing Run Right");
            AddAnimation(Const.ANIMATION.ATTACK_FIREBALL_BIG, "Standing 1H Magic Attack 01");
            AddAnimation(Const.ANIMATION.ATTACK_FIREBALL_SMALL, "Standing 2H Magic Attack 01");
            AddAnimation(Const.ANIMATION.ATTACK_SPELL_GROUND, "Standing 2H Cast Spell 01");

            _fsm = new PlayerFSM(this, _animState.obj, _character.obj);
        }
コード例 #3
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);
        }
コード例 #4
0
ファイル: AnimController.cs プロジェクト: nakoff/3dRpg
 public AnimController(Animator animator, AnimStateObject obj)
 {
     _animator  = animator;
     _animState = new AnimStateModel(obj);
     _animState.Subscribe(OnAnimStateChanged);
 }