Exemplo n.º 1
0
    //public override void OnSceneOpened(params object[] sceneData)
    //{
    //    base.OnSceneOpened(sceneData);
    //    EventDispatcher.AddEventListener(MessageCommand.OnEnterRoom, OnEnterRoom);
    //}

    //public override void OnSceneClosed()
    //{
    //    base.OnSceneClosed();
    //    EventDispatcher.RemoveEventListener(MessageCommand.OnEnterRoom, OnEnterRoom);
    //}

    //void OnEnterRoom(params object[] args)
    //{
    //    Game.UIMgr.PushScene(UIPage.PlayPage);
    //}

    void SetupUI()
    {
        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);

        if (Game.Instance.RoomConfig != null)
        {
            foreach (RoomConfigModel config in Game.Instance.RoomConfig.roomList)
            {
                string matchType = config.matchType;
                if (config.roomType == RoomType.Normal.ToString())
                {
                    GameObject child = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RoomSub_RoomSub.gameObject);
                    child.SetActive(true);
                    RoomSub sub = child.GetComponent <RoomSub>();
                    sub.SetValue(config);
                    sub.detail.Button_Button.onClick.AddListener(() =>
                    {
                        Game.SoundManager.PlayClick();
                        List <int> list = null;
#if UNITY_EDITOR
                        if (null != LogPage.Instance)
                        {
                            list = LogPage.Instance.GetTestCard();
                        }
#endif
                        Game.SocketGame.DoENROLL(matchType, list);
                    });
                }
            }
        }
    }
Exemplo n.º 2
0
    public void OnGetApplyClubCallBack(ClientResponse response)
    {
        ClubAccountVO vo = JsonMapper.ToObject <ClubAccountVO>(response.message);

        if (vo.msgcode != 0)
        {
            TipsManagerScript.getInstance().setTips(vo.msgstring);
        }
        else
        {
            isagreePanelShow = true;
            agreeListPanel.SetActive(true);
            PrefabUtils.ClearChild(agreeListGrid);
            foreach (ClubAccount ac in vo.listaccount)
            {
                GameObject     child = PrefabUtils.AddChild(agreeListGrid, agreesub);
                agreeSubScript cs    = child.GetComponent <agreeSubScript>();
                cs.setValue(ac);
                cs.agreebtn.onClick.AddListener(() =>
                {
                    ClientRequest cr  = new ClientRequest();
                    cr.headCode       = APIS.AGREE_CLUB_REQUEST;
                    cr.messageContent = "{'agree':1,'uuid':" + ac.uuid + "}";
                    CustomSocket.getInstance().sendMsg(cr);
                });
                cs.nobtn.onClick.AddListener(() =>
                {
                    ClientRequest cr  = new ClientRequest();
                    cr.headCode       = APIS.AGREE_CLUB_REQUEST;
                    cr.messageContent = "{'agree':0,'uuid':" + ac.uuid + "}";
                    CustomSocket.getInstance().sendMsg(cr);
                });
            }
        }
    }
Exemplo n.º 3
0
    public void SetValue(PlayerFinalResult result, int maxHu, int maxPao)
    {
        detail.ID_Text.text = "ID:" + result.playerId;
        detail.Name_Text.text = result.playerName;
        //detail.Face_Image.sprite = Game.IconMgr.GetFace(result.headImage);
        Game.IconMgr.SetFace(detail.Face_Image, result.headImage);

        detail.RoomOwnerFlag_Image.gameObject.SetActive(result.roomOwner);
        detail.ZhuangTime_Text.text = result.bankerCount.ToString();
        detail.HuTime_Text.text = result.huCount.ToString();
        detail.PaoTime_Text.text = result.paoCount.ToString();
        detail.BaoTime_Text.text = result.moBaoCount.ToString();
        detail.Bao2Time_Text.text = result.baoZhongBaoCount.ToString();
        detail.ZhaTime_Text.text = result.kaiPaiZhaCount.ToString();
        detail.Score_TextMeshProUGUI.text = result.score.ToString();

        detail.WinFlag_Image.gameObject.SetActive(maxHu > 0 && result.huCount >= maxHu);
        detail.PaoFlag_Image.gameObject.SetActive(maxPao > 0 && result.paoCount >= maxPao);
        
        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);
        for(int i = 0; i < result.eachScore.Count; i++)
        {
            GameObject child = AddChild(detail.Content_GridLayoutGroup,detail.InningRankSub);
            InningRankSub Inningsub = child.GetComponent<InningRankSub>();
            Inningsub.SetValue(result.eachScore[i], i+1);
        }
    }
Exemplo n.º 4
0
    private void SetupUI()
    {
        ActAndNoticeMsgSyn msg = Game.Instance.ActAndNoticeMsg;

        bool isActive = tab == 1;

        detail.ActiveButton_NoticeActiveTabSub.detail.SelectFlag_Image.gameObject.SetActive(isActive);
        detail.NoticeButton_NoticeActiveTabSub.detail.SelectFlag_Image.gameObject.SetActive(!isActive);
        detail.ActiveSub_ActiveSub.gameObject.SetActive(isActive);
        detail.NoticeSub_NoticeSub.gameObject.SetActive(!isActive);

        if (null != msg)
        {
            if (isActive)
            {
                PrefabUtils.ClearChild(detail.ActiveSub_ActiveSub.detail.ListContent_GridLayoutGroup);
                detail.ActiveSub_ActiveSub.detail.ContentText_Text.text = "";

                foreach (ActMsgModel item in msg.acts)
                {
                    string ctt = item.content;

                    GameObject   go  = PrefabUtils.AddChild(detail.ActiveSub_ActiveSub.detail.ListContent_GridLayoutGroup, detail.ActiveSub_ActiveSub.detail.ActiveBtnSub_ActiveBtnSub);
                    ActiveBtnSub sub = go.GetComponent <ActiveBtnSub>();
                    sub.detail.Title_Text.text = item.title;
                    sub.detail.Normal_Image.gameObject.SetActive(true);
                    sub.detail.SelectFlag_Image.gameObject.SetActive(false);

                    sub.detail.Button_Button.onClick.AddListener(() => {
                        Game.SoundManager.PlayClick();
                        if (null != selectSub)
                        {
                            selectSub.detail.Normal_Image.gameObject.SetActive(true);
                            selectSub.detail.SelectFlag_Image.gameObject.SetActive(false);
                        }
                        selectSub = sub;

                        selectSub.detail.Normal_Image.gameObject.SetActive(false);
                        selectSub.detail.SelectFlag_Image.gameObject.SetActive(true);
                        detail.ActiveSub_ActiveSub.detail.ContentText_Text.text = ctt;
                    });

                    if (null == selectSub)
                    {
                        selectSub = sub;

                        selectSub.detail.Normal_Image.gameObject.SetActive(false);
                        selectSub.detail.SelectFlag_Image.gameObject.SetActive(true);
                        detail.ActiveSub_ActiveSub.detail.ContentText_Text.text = ctt;
                    }
                }
            }
            else
            {
                detail.NoticeSub_NoticeSub.detail.ContentText_Text.text = msg.notice;
                //detail.NoticeSub_NoticeSub.detail.ContentText_Text.text ="西凉3D麻将已上线";
            }
        }
    }
Exemplo n.º 5
0
    private void SetupUI()
    {
        detail.Time_Text.text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        ClearCard();
        PrefabUtils.ClearChild(detail.Grid_GridLayoutGroup);

        if (null != RoomMgr.huSyn)
        {
            detail.Title_TextMeshProUGUI.text = MJUtils.GetHuType(RoomMgr.huSyn.resultType);

            if (RoomMgr.huSyn.resultType == MJUtils.HU_LiuJu)
            {
                foreach (GameOperPlayerSettle settle in RoomMgr.huSyn.detail)
                {
                    if (settle.position == Game.MJMgr.MyPlayer.postion)
                    {
                        SetupSub(detail.RoundAccountSub0_RoundAccountSub, settle, RoomMgr.huSyn.card);
                    }
                    else
                    {
                        GameObject      child = PrefabUtils.AddChild(detail.Grid_GridLayoutGroup, detail.RoundAccountSub1_RoundAccountSub);
                        RoundAccountSub sub   = child.GetComponent <RoundAccountSub>();
                        SetupSub(sub, settle);
                    }
                }
            }
            else
            {
                foreach (GameOperPlayerSettle settle in RoomMgr.huSyn.detail)
                {
                    if (settle.position == RoomMgr.huSyn.position)
                    {
                        SetupSub(detail.RoundAccountSub0_RoundAccountSub, settle, RoomMgr.huSyn.card);
                    }
                    else
                    {
                        GameObject      child = PrefabUtils.AddChild(detail.Grid_GridLayoutGroup, detail.RoundAccountSub1_RoundAccountSub);
                        RoundAccountSub sub   = child.GetComponent <RoundAccountSub>();
                        SetupSub(sub, settle);
                    }
                }
            }
        }

        PrefabUtils.ClearChild(detail.SingleCard_UIItem);
        SpawnCard(detail.SingleCard_UIItem.transform, Game.MJMgr.cardHui); //TODO wxd 结算界面的显示

        detail.M0_UIItem.gameObject.SetActive(MJUtils.HasWanfa(MJUtils.MODE_DAIHUI));
        detail.M1_UIItem.gameObject.SetActive(false);
        detail.M2_UIItem.gameObject.SetActive(false);
        detail.M3_UIItem.gameObject.SetActive(false);

        detail.M4_UIItem.gameObject.SetActive(false);
        detail.M5_UIItem.gameObject.SetActive(false);
        detail.M6_UIItem.gameObject.SetActive(false);
        detail.M7_UIItem.gameObject.SetActive(false);

        // TODO 结算界面
    }
Exemplo n.º 6
0
 public void addRoomList(List <ClubRoomVO> list)
 {
     PrefabUtils.ClearChild(roomListGrid);
     foreach (ClubRoomVO ac in list)
     {
         GameObject        child = PrefabUtils.AddChild(roomListGrid, clubroomSub);
         clubRoomSubScript cs    = child.GetComponent <clubRoomSubScript>();
         cs.setValue(ac);
     }
 }
Exemplo n.º 7
0
    public void ShowMood(int index)
    {
        showMood = true;
        detail.MoodRoot_UIItem.gameObject.SetActive(showMood);
        PrefabUtils.ClearChild(detail.MoodRoot_UIItem);
        GameObject go = PrefabUtils.AddChild(detail.MoodRoot_UIItem.gameObject, Game.IconMgr.moods[index]);

        Game.Delay(3, () => {
            showMood = false;
            detail.MoodRoot_UIItem.gameObject.SetActive(showMood);
            Destroy(go);
        });
    }
Exemplo n.º 8
0
    public void LineUp()
    {
        PrefabUtils.ClearChild(this.transform);
        for (int i = 0; i < count; i++)
        {
            Vector3    toPos = GetLocalPos(this.transform.childCount);
            GameObject child = PrefabUtils.AddChild(this.transform.gameObject, mj);

            child.transform.localScale    = Vector3.one;
            child.transform.localRotation = Quaternion.identity;
            child.transform.localPosition = toPos;
        }
    }
Exemplo n.º 9
0
 private void SetupUI()
 {
     PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);
     if (null != result)
     {
         foreach (RoomResultModel rs in result.list)
         {
             long          roomId = rs.roomId;
             GameObject    child  = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RoomRecordSub_RoomRecordSub);
             RoomRecordSub sub    = child.GetComponent <RoomRecordSub>();
             sub.SetValue(rs);
         }
     }
 }
Exemplo n.º 10
0
    private void SetupUI()
    {
        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);

        if (null != result)
        {
            foreach (VipRoomModel room in result.roomList)
            {
                string      code  = room.code;
                GameObject  child = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RoomListSub_RoomListSub);
                RoomListSub sub   = child.GetComponent <RoomListSub>();
                sub.SetValue(room);

                sub.detail.DismissButton_Button.onClick.AddListener(() =>
                {
                    Game.SoundManager.PlayClick();
                    Game.SocketGame.DoDismissVipRoom(code);
                });

                List <PlayerModel> playerList = room.players;
                sub.detail.PlayerButton_Button.onClick.AddListener(() =>
                {
                    Game.SoundManager.PlayClick();
                    detail.CloseBanButton_Button.gameObject.SetActive(true);
                    detail.BanPlayerSub_BanPlayerSub.gameObject.SetActive(true);
                    detail.BanPlayerSub_BanPlayerSub.transform.position = sub.detail.PlayerButton_Button.transform.position;
                    PrefabUtils.ClearChild(detail.BanPlayerSub_BanPlayerSub.detail.Grid_GridLayoutGroup);
                    foreach (PlayerModel player in playerList)
                    {
                        PlayerModel p     = player;
                        GameObject child1 = PrefabUtils.AddChild(detail.BanPlayerSub_BanPlayerSub.detail.Grid_GridLayoutGroup, detail.BanPlayerSub_BanPlayerSub.detail.BanSub_BanSub);
                        BanSub sub1       = child1.GetComponent <BanSub>();
                        sub1.SetValue(p);
                        sub1.detail.Button_Button.onClick.AddListener(() =>
                        {
                            Game.SoundManager.PlayClick();
                            Game.SocketGame.DoKickPlayer(code, p.playerId);
                        });
                    }
                });

                sub.detail.WxButton_Button.onClick.AddListener(() =>
                {
                    Game.SoundManager.PlayClick();
                    MyShareSDK.MyshareSDK.Share();
                });
            }
        }
    }
Exemplo n.º 11
0
    void ClearSelectPanel()
    {
        for (int a = 0; a < detail.SelectRoot_HorizontalLayoutGroup.transform.childCount; a++)
        {
            Transform sGroup = detail.SelectRoot_HorizontalLayoutGroup.transform.GetChild(a);
            for (int b = 0; b < sGroup.childCount; b++)
            {
                Transform sCard = sGroup.GetChild(b);
                Game.PoolManager.MjPool.Despawn(sCard);
            }
        }

        PrefabUtils.ClearChild(detail.SelectRoot_HorizontalLayoutGroup);
        detail.SelectPanel_UIItem.gameObject.SetActive(false);
    }
Exemplo n.º 12
0
 private void SetupUI()
 {
     PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);
     if (null != result)
     {
         foreach (RoomResultModel rs in result.list)
         {
             long           roomId = rs.roomId;
             GameObject     child  = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.TotalRecrodSub_TotalRecrodSub);
             TotalRecrodSub sub    = child.GetComponent <TotalRecrodSub>();
             sub.SetValue(rs);
             sub.detail.Button_Button.onClick.AddListener(() => {
                 Game.SoundManager.PlayClick();
                 Game.SocketHall.DoRoomResult(roomId, (response) => {
                     Game.UIMgr.PushScene(UIPage.RoomRecordPage, response);
                 });
             });
         }
     }
 }
Exemplo n.º 13
0
    public void OnGetAllClubCallBack(ClientResponse response)
    {
        ClubAccountVO vo = JsonMapper.ToObject <ClubAccountVO>(response.message);

        if (vo.msgcode != 0)
        {
            TipsManagerScript.getInstance().setTips(vo.msgstring);
        }
        else
        {
            ismerberlistshow = true;
            menberListobj.SetActive(true);
            PrefabUtils.ClearChild(menberListGrid);
            foreach (ClubAccount ac in vo.listaccount)
            {
                GameObject      child = PrefabUtils.AddChild(menberListGrid, merbersub);
                merberSubScript cs    = child.GetComponent <merberSubScript>();
                cs.setValue(ac);
            }
        }
    }
Exemplo n.º 14
0
    private void SetupUI()
    {
        MallProductResponse resp = Game.Instance.MallProduct;

        if (null != resp)
        {
            PrefabUtils.ClearChild(detail.CardsGrid_GridLayoutGroup);
            PrefabUtils.ClearChild(detail.CoinsGrid_GridLayoutGroup);
            foreach (MallProductModel model in resp.products)
            {
                if (model.category == 1)
                {
                    GameObject  child = PrefabUtils.AddChild(detail.CardsGrid_GridLayoutGroup, detail.ShopCardSub_ShopCardSub);
                    ShopCardSub sub   = child.GetComponent <ShopCardSub>();
                    sub.SetValue(model);
                }
                else
                {
                    GameObject   child = PrefabUtils.AddChild(detail.CoinsGrid_GridLayoutGroup, detail.ShopCoinsSub_ShopCoinsSub);
                    ShopCoinsSub sub   = child.GetComponent <ShopCoinsSub>();
                    sub.SetValue(model);
                }
            }
        }
        //foreach (ConfigShop config in ConfigShop.datas)
        //{
        //    if(config.ShopType == 1)
        //    {
        //        GameObject child = PrefabUtils.AddChild(detail.CardsGrid_GridLayoutGroup, detail.ShopCardSub_ShopCardSub);
        //        ShopCardSub sub = child.GetComponent<ShopCardSub>();
        //        sub.SetValue(config);
        //    }else
        //    {
        //        GameObject child = PrefabUtils.AddChild(detail.CoinsGrid_GridLayoutGroup, detail.ShopCoinsSub_ShopCoinsSub);
        //        ShopCoinsSub sub = child.GetComponent<ShopCoinsSub>();
        //        sub.SetValue(config);
        //    }
        //}
    }
Exemplo n.º 15
0
    //void OnEnterRoom(params object[] args)
    //{
    //    //OnBackPressed();
    //    Game.UIMgr.PushScene(UIPage.PlayPage);
    //}

    void SetupRank(params object[] args)
    {
        Image gameRank = detail.GameRankButton_MainRankTabSub.detail.SelectFlag_Image;

        if (null != gameRank && null != gameRank.gameObject)
        {
            gameRank.gameObject.SetActive(isRoundRank);
        }

        Image wealthRank = detail.WealthRankButton_MainRankTabSub.detail.SelectFlag_Image;

        if (null != wealthRank && null != wealthRank.gameObject)
        {
            wealthRank.gameObject.SetActive(!isRoundRank);
        }

        PrefabUtils.ClearChild(detail.Content_GridLayoutGroup);

        RankSyn rank = Game.Instance.RankSyn;

        if (null != rank)
        {
            List <RankItem> list = rank.coinList;
            if (isRoundRank)
            {
                list = rank.gameCountList;
            }

            foreach (RankItem item in list)
            {
                GameObject child = PrefabUtils.AddChild(detail.Content_GridLayoutGroup, detail.RankSub_RankSub);
                RankSub    sub   = child.GetComponent <RankSub>();
                sub.SetupUI(item, isRoundRank);
            }
        }
    }
Exemplo n.º 16
0
 public void Clear(MonoBehaviour mono)
 {
     PrefabUtils.ClearChild(mono);
 }