예제 #1
0
        public async override void Run()
        {
            ETModel.Game.Scene.GetComponent <SoundComponent>().PlayClip(DataCenterComponent.Instance.soundInfo.click);

            DDZGameHelper.CurrentGameInfo = GameHelper.GetGameInfo(GameType.DouDiZhu);

            GameHelper.CurrentGameInfo = GameHelper.GetGameInfo(GameType.DouDiZhu);

            GameHelper.CurrentGameInfo.GameId = 1;

            var ares = await GameHelper.GetGameAreaList(DDZGameHelper.CurrentGameInfo.GameId);

            DDZUIFactory.Init();

            //OnDDZ_LevelButton();
            GameLobbyFactory.Remove();

            var ui = Game.Scene.GetComponent <UIComponent>()?.Get(UIType.UIDDZFieldScene);

            if (ui == null)
            {
                DDZUIFactory.fieldScene.Create();
            }
            else
            {
                ui.GetComponent <UIDDZFieldScene>().OnShow();
            }
        }
예제 #2
0
        public override void Run(int GameId, int RoomId, GameReBackData backData)
        {
            if (GameId == 7)
            {
                DDZGameHelper.CurrentGameInfo = GameHelper.GetGameInfo(GameType.DouDiZhu);

                GameLobbyFactory.Remove();

                DDZUIFactory.Init();

                DDZGameHelper.RoomId = RoomId;

                DDZGameHelper.CurrentFieldId = backData.index;

                //清除重回数据
                backData = null;

                DataCenterComponent.Instance.GameReBackInfo.backData = null;

                DataCenterComponent.Instance.GameReBackInfo.isBackSuccess = false;

                PlayerPrefs.DeleteKey(DataCenterComponent.Instance.GameReBackInfo.reBackDataKey);

                DDZUIFactory.gameScene.Create();
            }
        }
예제 #3
0
        /// <summary>
        /// 通用场等级选择方法
        /// </summary>
        /// <param name="gameType"></param>
        public async Task <bool> OnSelectedArea(GameType gameType)
        {
            GameHelper.CurrentGameInfo = GameHelper.GetGameInfo(gameType);

            if (GameHelper.CurrentGameInfo == null)
            {
                Game.PopupComponent.ShowMessageBox(DataCenterComponent.Instance.tipInfo.GameNotOpenTip);

                return(false);
            }

            GameTypeImage.sprite = GameHelper.GetSprite("chooseareaatlas", $"choosearea_game{((int)gameType) - 1}");

            GameTypeImage.SetNativeSize();
            GameTypeBgImage.sprite = GameHelper.GetSprite("chooseareaatlas", $"bgchoosearea_game{((int)gameType) - 1}");
            // 获取场
            var ares = await GameHelper.GetGameAreaList(GameHelper.CurrentGameInfo.GameId);

            if (ares != null)
            {
                lobby.GameLobbyGameListPlugin._GameType.SetActive(false);

                _BackGameListsButton.SetActive(true);
            }
            else
            {
                return(false);
            }

            if (ares.Count == 2)
            {
                LevelButton_low.SetActive(true);

                LevelButton_middle.SetActive(false);

                LevelButton_high.SetActive(true);

                _GameLevelPanel.GetComponent <GridLayoutGroup>().spacing = new Vector2(250, 0);

                SetLevelUIData(LevelButton_low, ares[0]);

                SetLevelUIData(LevelButton_high, ares[1]);
            }
            else if (ares.Count == 3)
            {
                LevelButton_low.SetActive(true);

                LevelButton_middle.SetActive(true);

                LevelButton_high.SetActive(true);

                _GameLevelPanel.GetComponent <GridLayoutGroup>().spacing = new Vector2(139, 0);

                SetLevelUIData(LevelButton_low, ares[0]);

                SetLevelUIData(LevelButton_middle, ares[1]);

                SetLevelUIData(LevelButton_high, ares[2]);
            }
            else if (ares.Count == 1)
            {
                lobby.GameLobbyGameListPlugin._GameType.SetActive(true);

                _BackGameListsButton.SetActive(false);

                return(true);
            }
            else
            {
                return(false);
            }

            // 显示场等级选择
            _GameLevelPanel.SetActive(true);

            _GameTypeBg.SetActive(true);

            MaskBg.SetActive(true);

            _BackGameListsButton.SetActive(true);

            return(true);
        }
예제 #4
0
        /// <summary>
        /// 保存游戏信息
        /// </summary>
        /// <param name="GameId"></param>
        private void SaveGameInfo(int GameId)
        {
            GameHelper.CurrentGameInfo = GameHelper.GetGameInfo((GameType)GameId);

            GameHelper.CurrentGameInfo.GameId = GameId;
        }