public void SetData(cmd_entity_clan_order_info info) { index.text = info.nOrderID.ToString(); clanName.text = info.szKinName; score.text = info.dwTotalFightCapacity.ToString(); number.text = info.dwPlayerCount.ToString(); leader.text = info.szShaikhName.ToString(); bool bTop3 = false; if (info.nOrderID == 1 || info.nOrderID == 2 || info.nOrderID == 3) { bTop3 = true; indexIcon.gameObject.SetActive(true); indexIcon.sprite = top3IndexIcons[info.nOrderID - 1]; index.gameObject.SetActive(false); } if (!U3D_Render.EntityView.isNullOrEmpty(EntityFactory.MainHeroView)) { if (EntityFactory.MainHeroView.Property) { if (EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CLAN) == info.dwClanID) { bSelfItem = true; borderImg.sprite = borderList[1]; } } } Color txtColor = bTop3 ? top3TextColor[info.nOrderID - 1] : Color.white; index.color = txtColor; clanName.color = txtColor; score.color = txtColor; number.color = txtColor; leader.color = txtColor; }
//接收联盟榜数据 public void OnRecvRequestClanRankData(IntPtr ptr, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen); cmd_Entity_Rank_Info_head head = helper.get <cmd_Entity_Rank_Info_head>(); ClanChartList.AllDataList.Clear(); for (int i = 0; i < head.nCount; i++) { cmd_entity_clan_order_info data = helper.get <cmd_entity_clan_order_info>(); if (EntityFactory.MainHeroView != null && EntityFactory.MainHeroView.Property != null) { if ((int)data.dwClanID == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CLAN)) { ClanChartList.PersonalRank = (int)data.nOrderID; } } ClanChartList.AllDataList.Add(data); } if (ClanChartList.AllDataList.Count > 0) { ClanChartList.LastScore = (int)ClanChartList.AllDataList[head.nCount - 1].dwTotalFightCapacity; } UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_RECVREQUESTCLANCHARTDATA, null); }