public override void CreateViewModel() { if (UseEmptyViewModel || string.IsNullOrEmpty(ViewModelInitValueJson)) { VM = new GameCoreViewModel(); } else { VM = JsonConvert.DeserializeObject <GameCoreViewModel> (ViewModelInitValueJson); ViewModelPropertyRef(); } VM.AddHostView(ViewModelBase.DefaultViewBaseKey, this); }
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); }); }
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); }
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())); }
/* */ public override void RemoveSomeBullet(GameCoreViewModel viewModel) { base.RemoveSomeBullet(viewModel); }
/* */ public override void AddSomeBullet(GameCoreViewModel viewModel) { base.AddSomeBullet(viewModel); }
public virtual void GameStateChanged(GameCoreViewModel viewModel, GameCoreFSM.State newState, GameCoreFSM.State oldState) { }
/* */ public virtual void RemoveSomeBullet(GameCoreViewModel viewModel) { }
/* */ public virtual void AddSomeBullet(GameCoreViewModel viewModel) { }
public override void SetViewModel(ViewModelBase viewModel) { VM = (GameCoreViewModel)viewModel; }