Exemple #1
0
 public void read(MemoryStream msdata)
 {
     code = proto_util.readUShort(msdata);
     sum  = proto_util.readUShort(msdata);
     PGuildBase.readLoop(msdata, list);
     page    = proto_util.readUShort(msdata);
     allPage = proto_util.readUShort(msdata);
 }
Exemple #2
0
        //更新审核列表
        private void UpdateOtherGuildList()
        {
            List <PGuildBase> dataList = Singleton <GuildMode> .Instance.OtherGuildList;

            if (null == dataList)
            {
                return;
            }

            int curCount    = otherGuildList.Count;
            int targetCount = dataList.Count;

            //增加新Button
            for (int i = 0; i < (targetCount - curCount); i++)
            {
                GameObject newGo = GameObject.Instantiate(otherGuildList[0].gameObject) as GameObject;
                newGo.gameObject.name         = otherGuildList[0].gameObject.name;
                newGo.transform.parent        = otherGuildList[0].transform.parent.transform;
                newGo.transform.localPosition = Vector3.zero;
                newGo.transform.localRotation = Quaternion.identity;
                newGo.transform.localScale    = Vector3.one;
                NGUITools.SetLayer(newGo, LayerMask.NameToLayer("UI"));

                otherGuildList.Add(newGo.GetComponent <Button>());
            }

            //显示隐藏相应的Buttton
            for (int i = 0; i < otherGuildList.Count; i++)
            {
                if (i < targetCount)
                {
                    otherGuildList[i].SetActive(true);
                    PGuildBase item = dataList[i];

                    UILabel labRank      = otherGuildList[i].gameObject.transform.Find("rank").GetComponent <UILabel>();
                    UILabel labName      = otherGuildList[i].gameObject.transform.Find("guildname").GetComponent <UILabel>();
                    UILabel labLeader    = otherGuildList[i].gameObject.transform.Find("leader").GetComponent <UILabel>();
                    UILabel labGrade     = otherGuildList[i].gameObject.transform.Find("grade").GetComponent <UILabel>();
                    UILabel labPersonCnt = otherGuildList[i].gameObject.transform.Find("personcount").GetComponent <UILabel>();
                    Button  btnShowGuild = otherGuildList[i].gameObject.transform.Find("btn_show").GetComponent <Button>();
                    btnShowGuild.onClick    = ShowGuildOnClick;
                    btnShowGuild.label.text = LanguageManager.GetWord("Guild.ShowGuild");

                    labRank.text      = item.lvl.ToString();
                    labName.text      = item.name;
                    labLeader.text    = item.ownerName;
                    labGrade.text     = item.rank.ToString();
                    labPersonCnt.text = item.memberNum.ToString();
                }
                else
                {
                    otherGuildList[i].SetActive(false);
                }
            }

            //当前页数
            int pageIndex = Singleton <GuildMode> .Instance.PageIndex;

            if (pageIndex > Singleton <GuildMode> .Instance.PageCount)
            {
                pageIndex = 0;
            }

            string[] param = { pageIndex.ToString(), Singleton <GuildMode> .Instance.PageCount.ToString() };
            labOtherGuildCurPage.text = LanguageManager.GetWord("Guild.CurPage", param);

            otherGuildGrid.repositionNow = true;
        }
 public void read(MemoryStream msdata)
 {
     PGuildBase.readLoop(msdata, guildList);
 }