Ejemplo n.º 1
0
        //更新审核列表
        private void UpdateMyGuildVerifyList()
        {
            List <PGuildApplyMember> dataList = Singleton <GuildMode> .Instance.VerifyList;

            if (null == dataList)
            {
                return;
            }

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

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

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

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

                    UILabel labName      = verifyList[i].gameObject.transform.Find("name").GetComponent <UILabel>();
                    UILabel labGrade     = verifyList[i].gameObject.transform.Find("grade").GetComponent <UILabel>();
                    UILabel labApplyTime = verifyList[i].gameObject.transform.Find("applytime").GetComponent <UILabel>();
                    Button  btnAccept    = verifyList[i].gameObject.transform.Find("btn_accept").GetComponent <Button>();
                    Button  btndeny      = verifyList[i].gameObject.transform.Find("btn_deny").GetComponent <Button>();
                    btnAccept.onClick    = AcceptOnClick;
                    btndeny.onClick      = DenyOnClick;
                    btnAccept.label.text = LanguageManager.GetWord("Guild.Accept");
                    btndeny.label.text   = LanguageManager.GetWord("Guild.Deny");

                    labName.text      = item.name;
                    labGrade.text     = item.lvl.ToString();
                    labApplyTime.text = TimeUtil.GetTimeYyyymmdd(item.time);
                }
                else
                {
                    verifyList[i].SetActive(false);
                }
            }

            verifyGrid.repositionNow = true;
        }
Ejemplo n.º 2
0
        //审核
        private void Verify(GameObject go, bool result)
        {
            Button currentItem = go.transform.parent.GetComponent <Button>();
            int    index;

            for (index = 0; index < verifyList.Count; index++)
            {
                if (verifyList[index].Equals(currentItem))
                {
                    break;
                }
            }

            if (index >= verifyList.Count)
            {
                return;
            }

            PGuildApplyMember item = Singleton <GuildMode> .Instance.VerifyList[index];

            Singleton <GuildMode> .Instance.Verify(item.id, result);
        }
 public void read(MemoryStream msdata)
 {
     code = proto_util.readUShort(msdata);
     PGuildApplyMember.readLoop(msdata, list);
 }