Ejemplo n.º 1
0
        public void Show()
        {
            gameObject.SetActive(true);
            FBRoundModel roundModel = GetModel <FBRoundModel>();

            UpdatteRoundInfo(roundModel.RoundIndex + 1, roundModel.RoundTotal);
        }
Ejemplo n.º 2
0
        public override void Execute(object data = null)
        {
            //游戏开始
            FBGameModel gameModel = GetModel <FBGameModel>();

            gameModel.IsPlaying = true;

            //出怪
            FBRoundModel roundModel = GetModel <FBRoundModel>();

            roundModel.StartRound();
        }
        public override void Execute(object data = null)
        {
            FBStartLevelArgs e = data as FBStartLevelArgs;
            //第一步
            FBGameModel gameModel = GetModel <FBGameModel>();

            gameModel.StartLevel(e.ID);

            //第二步
            FBRoundModel roundModel = GetModel <FBRoundModel>();

            roundModel.LoadLevel(gameModel.PlayLevel);

            // 进入游戏
            FBGame.Instance.LoadScene(3);
        }
Ejemplo n.º 4
0
        private void MonsterDead(FBRole monster)
        {
            //回收
            FBGame.Instance.ObjectPool.Unspawn(monster.gameObject);

            GameObject[] monsters   = GameObject.FindGameObjectsWithTag("Monster");
            FBRoundModel roundModel = GetModel <FBRoundModel>();

            //  萝卜没死             场景上已没有怪物           所有怪物已出完
            if (!f_carrot.IsDead && monsters.Length <= 0 && roundModel.AllRoundComplete)
            {
                FBGameModel gameModel = GetModel <FBGameModel>();
                //游戏胜利
                SendEvent(FBConsts.E_LevelEnd, new FBEndLevelArgs()
                {
                    ID = gameModel.PlayLevelIndex, IsWin = true
                });
            }
        }
        public override void Execute(object data = null)
        {
            FBEndLevelArgs e = data as FBEndLevelArgs;

            //保存游戏状态
            FBGameModel  gameModel  = GetModel <FBGameModel>();
            FBRoundModel roundModel = GetModel <FBRoundModel>();

            roundModel.StopRound();
            gameModel.StoptLevel(e.IsWin);

            //弹出UI
            if (e.IsWin)
            {
                GetView <FBUIWin>().Show();
            }
            else
            {
                GetView <FBUILost>().Show();
            }
        }