Пример #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
        /// <summary>
        /// 确认回调
        /// </summary>
        public async void OkAction()
        {
            await Task.Delay(200);

            Game.PopupComponent.ShowLoadingLockUI(DataCenterComponent.Instance.tipInfo.TryRebackGameTip);

            await GameHelper.GetGameList();//获取一下游戏列表

            this.SaveGameInfo(this.backData.GameId);

            var ares = await GameHelper.GetGameAreaList(GameHelper.CurrentGameInfo.GameId);                 //获取场列表

            var roomList = await GameHelper.GetRoomList(GameHelper.CurrentGameInfo.GameId, ares[0].AreaId); //获取房间列表

            this.RequestJoinRoom(backData.GameId, backData.AreaId, backData.RoomId, backData.index);        //重新加入房间
        }
Пример #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);
        }