Пример #1
0
        public void SetData(RequestJoinData data)
        {
            this.data = data;
            approveID = data.approveID;

            nameLabel.text       = data.name;
            levelLabel.text      = data.level.ToString();
            headIcon.spriteName  = data.headIcon;// "Partner_Head_Sidatuila"; // 暂时默认
            frameIcon.spriteName = Data.EconemyTemplateManager.Instance.GetHeadFrame(data.headFrame).iconId;
            ShowUI(true);
        }
Пример #2
0
        public void SetAllianceApplys(List <AllianceApply> applies)
        {
            int d = applies.Count - legionData.listRequestJoin.Count;

            if (d > 0)
            {
                for (int i = 0; i < d; i++)
                {
                    RequestJoinData rjd = new RequestJoinData();
                    legionData.listRequestJoin.Add(rjd);
                }
            }
            else if (d < 0)
            {
                for (int i = 0; i < -d; i++)
                {
                    legionData.listRequestJoin.RemoveAt(legionData.listRequestJoin.Count - 1);
                }
            }

            int index = 0;

            for (int i = 0; i < applies.Count; i++)
            {
                RequestJoinData rjd  = legionData.listRequestJoin[index];
                AllianceApply   data = applies[i];
                if (data == null) //如果为空就移除
                {
                    legionData.listRequestJoin.RemoveAt(legionData.listRequestJoin.Count - 1);
                    continue;
                }
                rjd.name      = data.Name;
                rjd.level     = data.Level;
                rjd.approveID = data.Uid;
                rjd.headIcon  = data.Portrait;
                rjd.headFrame = data.Frame;
                index++;
            }

            if (LegionEvent.NotifyUpdateLegionData != null)
            {
                LegionEvent.NotifyUpdateLegionData(legionData);
            }
        }
Пример #3
0
        public void SetData(LegionData data)
        {
            limitLevelLabel.text = data.conditionLevel.ToString();
            requestNumLabel.text = data.listRequestJoin.Count.ToString();

            IsOpenApprove = data.isNeedApprove;

            //int num = data.listRequestJoin.Count;
            //LTUIUtil.SetNumTemplate(approveItemTemplate, listApproveItem, num, itemBehind);

            if (data.listRequestJoin.Count > listApproveItem.Count)
            {
                int length = data.listRequestJoin.Count;
                int index  = listApproveItem.Count;

                for (int i = index; i < length; i++)
                {
                    GameObject go = Object.Instantiate(approveItemTemplate.mDMono.gameObject);
                    go.transform.parent     = grid.transform;
                    go.transform.localScale = approveItemTemplate.mDMono.transform.localScale;
                    LegionApproveItem item = go.GetMonoILRComponent <LegionApproveItem>();
                    listApproveItem.Add(item);
                }
                grid.Reposition();
            }

            for (int i = 0; i < listApproveItem.Count; i++)
            {
                if (i < data.listRequestJoin.Count)
                {
                    RequestJoinData   joinData = data.listRequestJoin[i];
                    LegionApproveItem item     = listApproveItem[i];
                    item.SetData(joinData);
                    item.SetAction(OnClickConsentApprove, OnClickRefuseApprove);
                }
                else
                {
                    listApproveItem[i].ShowUI(false);
                }
            }

            //权限
            if (data.userMemberData != null)
            {
                switch (data.userMemberData.dutyType)
                {
                case eAllianceMemberRole.Member:
                case eAllianceMemberRole.Admin:
                    ChangeOpen(false);
                    break;

                case eAllianceMemberRole.ExtraOwner:
                case eAllianceMemberRole.Owner:
                    ChangeOpen(true);
                    break;
                }
            }

            if (scrollView != null)
            {
                scrollView.RestrictWithinBounds(true);
            }
        }