public void onRecvHeroKingRankData(int nHeroID) { List <cmd_entity_king_of_hero_order_info> dataList = new List <cmd_entity_king_of_hero_order_info>(); dataList = LogicDataCenter.chartDataManager.KingOfHeroChartList.AllDataList; int count = KingOfHeroContainer.childCount; for (int i = 0; i < count; i++) { Transform trs = KingOfHeroContainer.GetChild(i); if (trs != null) { HeroKingRankItem rankItem = trs.GetComponent <HeroKingRankItem>(); if (rankItem != null) { rankItem.Clear(); if (dataList.Count > i) { rankItem.SetData(dataList[i]); } } } } }
public void RequestHeroKingRankData(int id, string name) { ViewEventHelper.Instance.SendCommand(GameLogicDef.GVIEWCMD_OPEN_KING_OF_HERO_ORDER, id); int count = KingOfHeroContainer.childCount; for (int i = 0; i < count; i++) { Transform trs = KingOfHeroContainer.GetChild(i); if (trs != null) { HeroKingRankItem rankItem = trs.GetComponent <HeroKingRankItem>(); if (rankItem != null) { rankItem.Clear(); } } } KingOfHeroIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_PLAYERFRAME, 1, 3, id); KingOfHeroName.text = name; KingOfHeroFrame.gameObject.SetActive(true); }