public override void OnRegister() { base.OnRegister(); gameModel = uManager.GetModel <IMyGameModel>() as MyGameModel; clientTouchOrder = new List <int>(); //AddListener(GameEvents.TOUCH, TouchHandler); AddListener(GameEvents.CHECK_TOUCH_ORDER, CheckTouchOrder); AddListener(GameEvents.CREATE_TOUCH_ORDER, CreatedTouchOrder); AddListener(GameEvents.SHOW_TURN_MESSAGE, ShowTurnMessage); AddListener(GameEvents.HIDE_TURN_MESSAGE, HideTurnMessage); }
public override void Execute(NotifyParam notify) { MyGameModel gameModel = uManager.GetModel <IMyGameModel>() as MyGameModel; string sceneName = notify.data as string; gameModel.Life = 1; SceneManager.LoadScene(sceneName); }
public override void OnRegister() { base.OnRegister(); gameModel = uManager.GetModel<IMyGameModel>() as MyGameModel; clientTouchOrder = new List<int>(); //AddListener(GameEvents.TOUCH, TouchHandler); AddListener(GameEvents.CHECK_TOUCH_ORDER, CheckTouchOrder); AddListener(GameEvents.CREATE_TOUCH_ORDER, CreatedTouchOrder); AddListener(GameEvents.SHOW_TURN_MESSAGE, ShowTurnMessage); AddListener(GameEvents.HIDE_TURN_MESSAGE, HideTurnMessage); }
public override void Execute(NotifyParam notify) { MyGameModel gameModel = uManager.GetModel <IMyGameModel>() as MyGameModel; gameModel.TouchOrder = new List <int>(); int random = Random.Range(1, 3); gameModel.TouchOrder.Add(random); Debug.Log("Random: " + random); random = Random.Range(1, 3); gameModel.TouchOrder.Add(random); Debug.Log("Random: " + random); random = Random.Range(1, 3); gameModel.TouchOrder.Add(random); Debug.Log("Random: " + random); }
private void UpdateLife(NotifyParam obj) { MyGameModel gameModel = uManager.GetModel <IMyGameModel>() as MyGameModel; _viewComp.lifeTxt.text = gameModel.Life.ToString(); }