Example #1
0
    /// <summary>
    /// 赋值每大局信息
    /// </summary>
    /// <param name="key"></param>
    public void  InitFrame(string key)
    {
        News_Pel_timeTxt = Info_Frame.transform.Find("Time").GetComponent <Text>();
        for (int i = 0; i < 4; i++)
        {
            News_Pel_headIge[i]  = Info_Frame.transform.Find("hard" + (i + 1) + "/head").GetComponent <Image>();
            News_Pel_scoreTxt[i] = Info_Frame.transform.Find("hard" + (i + 1) + "/score").GetComponent <Text>();
            FangzhuGo[i]         = Info_Frame.transform.Find("hard" + (i + 1) + "/Fangzhu").gameObject;
        }
        RoomInfoTxt  = Info_Frame.transform.Find("RoomInfo").GetComponent <Text>();
        playback_Btn = Info_Frame.transform.Find("playback_Btn").GetComponent <Button>();



        var time = TimeToLong.ConvertIntDateTime(userRecords[key].CreateDate);

        News_Pel_timeTxt.text = time.Year + "-" + time.Month + "-" + time.Day + "\n" + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0');
        for (int i = 0; i < userRecords[key].recordUserInfo.Count; i++)
        {
            News_Pel_headIge[i].transform.parent.gameObject.SetActive(true);
            LoadImage.Instance.LoadPicture(userRecords[key].recordUserInfo[i].headimg, News_Pel_headIge[i]);
            News_Pel_scoreTxt[i].text = userRecords[key].recordUserInfo[i].Score;
            if (userRecords[key].recordUserInfo[i].UserID == userRecords[key].UserID)
            {
                FangzhuGo[i].SetActive(true);
            }
        }
        RoomInfoTxt.text = hall.RoomInfo(userRecords[key].RoomMsg);
        playback_Btn.onClick.AddListener(delegate { OnSendGetUserGamePlayback(key); });
    }
Example #2
0
    /// <summary>
    /// 显示朋友圈大厅
    /// </summary>
    void ShowPengYQLobby()
    {
        Transform tf = PengYQLobby_Pel.transform.Find("Scroll View/Viewport/Content/QuanZi");

        Clear(tf.parent);
        PengYQLobby_Pel.transform.Find("bgLogo").gameObject.SetActive(true);
        foreach (var item in GameInfo.returnLobbyInfo.RoomListInfo)
        {
            PengYQLobby_Pel.transform.Find("bgLogo").gameObject.SetActive(false);
            Transform tf1 = Instantiate(tf, tf.parent) as Transform;
            //tf1.gameObject.SetActive(true);
            for (int i = 0; i < item.room_peo; i++)
            {
                tf1.Find("hard" + (i + 1)).gameObject.SetActive(true);
                if (i < item.PlayerList.Count)
                {
                    LoadImage.Instance.LoadPicture(item.PlayerList[i].picture, tf1.Find("hard" + (i + 1) + "/head").GetComponent <Image>());
                }
            }
            tf1.Find("roomId").GetComponent <Text>().text = "房间号:" + item.roomID.ToString();
            tf1.name = item.roomID.ToString();

            var time = TimeToLong.ConvertIntDateTime(item.CreateDate);
            tf1.Find("Time").GetComponent <Text>().text = "创建时间:" + time.Month + "/" + time.Day + " " + time.Hour.ToString().PadLeft(2, '0') + ":" + time.Minute.ToString().PadLeft(2, '0');


            ReturnRoomMsg msg = new ReturnRoomMsg();
            msg.is_benji      = item.is_benji;
            msg.is_shangxiaji = item.is_shangxiaji;
            msg.is_wgj        = item.is_wgj;
            msg.is_xinqiji    = item.is_xinqiji;
            msg.is_lianzhuang = item.is_lianzhuang;
            msg.is_yikousan   = item.is_yikousan;
            msg.Is_yuanque    = item.IsYuanQue;
            msg.QuickCard     = item.QuickCard;

            tf1.Find("method").GetComponent <Text>().text = "房间规则:" + hall.RoomInfo(msg);
            if (item.room_peo > item.PlayerList.Count)
            {
                tf1.Find("JoinRoomBtn").GetComponent <Button>().onClick.AddListener(delegate { enterRoom.gameObject.SetActive(true); enterRoom.roomidStr = tf1.name; GameInfo.GroupID = groupInfo.GroupID; enterRoom.OnEnterRoomClick(); });
                tf1.SetSiblingIndex(1);
            }
            else
            {
                tf1.Find("JoinRoomBtn").gameObject.SetActive(false);
                tf1.SetSiblingIndex(tf.parent.childCount - 1);
            }
        }
        PengYQLobby_Pel.transform.Find("Name").GetComponent <Text>().text    = "圈名:" + groupInfo.GroupName;
        PengYQLobby_Pel.transform.Find("QuanHao").GetComponent <Text>().text = "圈号:" + groupInfo.GroupID.ToString();
        //PengYQLobby_Pel.transform.Find("Intro").GetComponent<Text>().text = "圈子简介:\n\t\t" + groupInfo.GroupIntroduction;
        //PengYQLobby_Pel.transform.Find("LookInfoBtn").gameObject.SetActive(!groupInfo.IsGroupLord);
        PengYQInfo_Pel.transform.Find("Info_Pel/QuitBtn").gameObject.SetActive(!groupInfo.IsGroupLord);
        PengYQLobby_Pel.transform.Find("Scroll View").GetComponent <ScrollRectControl>().InitScrollRect(1, delegate { SendLobbyInfo(groupInfo.GroupID); Debug.Log(groupInfo.GroupID); });
        GameInfo.returnLobbyInfo = null;
    }