コード例 #1
0
        public override void CreateViewModel()
        {
            if (UseEmptyViewModel || string.IsNullOrEmpty(ViewModelInitValueJson))
            {
                VM = new GameCoreViewModel();
            }
            else
            {
                VM = JsonConvert.DeserializeObject <GameCoreViewModel> (ViewModelInitValueJson);
                ViewModelPropertyRef();
            }

            VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this);
        }
コード例 #2
0
        public override void Attach(ViewModelBase viewModel)
        {
            GameCoreViewModel vm = (GameCoreViewModel)viewModel;

            vm.RC_AddSomeBullet.Subscribe(_ => {
                AddSomeBullet((GameCoreViewModel)viewModel);
            }).AddTo(viewModel.baseAttachDisposables);
            vm.RC_RemoveSomeBullet.Subscribe(_ => {
                RemoveSomeBullet((GameCoreViewModel)viewModel);
            }).AddTo(viewModel.baseAttachDisposables);

            vm.FSM_GameState.Attach();
            vm.FSM_GameState.CurrentState.Pairwise().Subscribe(_ => {
                GameStateChanged((GameCoreViewModel)viewModel, _.Current, _.Previous);
            });
        }
コード例 #3
0
        public override void Initialize(ViewModelBase viewModel)
        {
            if (viewModel != null)
            {
                VM = (GameCoreViewModel)viewModel;
                VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this);
            }
            else
            {
                if (AutoCreateViewModel && VM == null)
                {
                    CreateViewModel();
                }
            }

            base.Initialize(VM);
        }
コード例 #4
0
 public override void GameStateChanged(GameCoreViewModel viewModel, GameCoreFSM.State newState, GameCoreFSM.State oldState)
 {
     base.GameStateChanged(viewModel, newState, oldState);
     PRDebug.TagLog("GameCoreController", Color.blue, string.Format("{0} -> {1}", oldState.ToString(), newState.ToString()));
 }
コード例 #5
0
 /*  */
 public override void RemoveSomeBullet(GameCoreViewModel viewModel)
 {
     base.RemoveSomeBullet(viewModel);
 }
コード例 #6
0
 /*  */
 public override void AddSomeBullet(GameCoreViewModel viewModel)
 {
     base.AddSomeBullet(viewModel);
 }
コード例 #7
0
 public virtual void GameStateChanged(GameCoreViewModel viewModel, GameCoreFSM.State newState, GameCoreFSM.State oldState)
 {
 }
コード例 #8
0
 /*  */
 public virtual void RemoveSomeBullet(GameCoreViewModel viewModel)
 {
 }
コード例 #9
0
 /*  */
 public virtual void AddSomeBullet(GameCoreViewModel viewModel)
 {
 }
コード例 #10
0
 public override void SetViewModel(ViewModelBase viewModel)
 {
     VM = (GameCoreViewModel)viewModel;
 }