Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);

        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        private void UpdateLife(NotifyParam obj)
        {
            MyGameModel gameModel = uManager.GetModel <IMyGameModel>() as MyGameModel;

            _viewComp.lifeTxt.text = gameModel.Life.ToString();
        }