public void UpdateUIData(PropDto propDto) { if (propDto == null) { foreach (var item in DaojuNumberList) { item.Value.text = "X0"; } return; } DaojuNumberList[DaoJuTable[0].id].text = "X" + propDto.exchangeCard; DaojuNumberList[DaoJuTable[1].id].text = "X" + propDto.kickingCard; DaojuNumberList[DaoJuTable[2].id].text = "X" + propDto.trumpetCard; }
public void UpdateUIData(PropDto propDto) { //更新道具数量,numbers待服务器传来 if (propDto == null) { foreach (var item in DaojuNumberList) { item.Value.text = "X0"; } return; } DaojuNumberList[DaoJuTable[0].id].text = "X" + propDto.exchangeCard; DaojuNumberList[DaoJuTable[1].id].text = "X" + propDto.kickingCard; DaojuNumberList[DaoJuTable[2].id].text = "X" + propDto.trumpetCard; //if (PlayerCache.weathInfo != null) //{ // if (PlayerCache.weathInfo.Props!= null) // { // List<ResourceModel> PropsList = PlayerCache.weathInfo.Props; // if (DaojuNumberList.Count > 0) // { // for (int i = 0; i < PropsList.Count; i++) // { // if (DaojuNumberList.ContainsKey(PropsList[i].Id)) // { // DaojuNumberList[PropsList[i].Id].text = "X" + PropsList[i].Count.ToString(); // } // } // } // } //} }
private void OnEnable() { PropDto propDto = PlayerCache.hallPlayerInfoOperation.playerPropInfo(PlayerCache.loginInfo.uid); UpdateUIData(propDto); }
private void OnEnable() { PropDto propDto = PlayerCache.hallPlayerInfoOperation.playerPropInfo(PlayerCache.CurrentOtherPlayerUID); UpdateUIData(propDto); }