コード例 #1
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);
        }
コード例 #2
0
        public FreezerPres(IFreezerView view) : base(ENTITY_TYPE.PLAYER)
        {
            _character          = CharacterModel.Create(Type, Id);
            _character.Position = view.Position;

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

            _interactSystem = new InteractSystem(this, interactModel.obj);

            _view = view;
            _view.interactController = interactController;
        }
コード例 #3
0
ファイル: InteractSystem.cs プロジェクト: nakoff/3dRpg
 public InteractSystem(FreezerPres entity, InteractStateObject interactObj)
 {
     _freezer       = entity;
     _interactState = new InteractStateModel(interactObj);
     _interactState.Subscribe(OnInteractControllerChanged);
 }
コード例 #4
0
 public InteractController(InteractStateObject obj)
 {
     _interactState = new InteractStateModel(obj);
 }