Example #1
0
 public void read(MemoryStream msdata)
 {
     code    = proto_util.readUShort(msdata);
     guildId = proto_util.readUInt(msdata);
     PGuildLog.readLoop(msdata, list);
     page    = proto_util.readUShort(msdata);
     allPage = proto_util.readUShort(msdata);
 }
Example #2
0
        //更新日志列表
        private void UpdateMyGuildLogList()
        {
            List <PGuildLog> dataList = Singleton <GuildMode> .Instance.LogList;

            if (null == dataList)
            {
                return;
            }

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

            //增加新Button
            for (int i = 0; i < (targetCount - curCount); i++)
            {
                GameObject newGo = GameObject.Instantiate(logList[0].gameObject) as GameObject;
                newGo.gameObject.name         = logList[0].gameObject.name;
                newGo.transform.parent        = logList[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"));

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

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

                    UILabel labName   = logList[i].gameObject.transform.Find("name").GetComponent <UILabel>();
                    UILabel labDevote = logList[i].gameObject.transform.Find("devote").GetComponent <UILabel>();
                    UILabel labTime   = logList[i].gameObject.transform.Find("time").GetComponent <UILabel>();

                    labName.text = item.name;
                    string[] param = { item.repu.ToString(), item.exp.ToString() };
                    labDevote.text = LanguageManager.GetWord("Guild.DevoteInfo", param);
                    labTime.text   = Singleton <GuildMode> .Instance.GetLogoutTimeStr(TimeUtil.GetElapsedTime(item.time));
                }
                else
                {
                    logList[i].SetActive(false);
                }
            }

            logGrid.repositionNow = true;
        }
Example #3
0
 public void read(MemoryStream msdata)
 {
     code = proto_util.readUShort(msdata);
     PGuildLog.readLoop(msdata, list);
 }
Example #4
0
 public void read(MemoryStream msdata)
 {
     PGuildLog.readLoop(msdata, list);
 }