public void CreateHistoryItem(int[] seatArray) { var gdata = App.GetGameData <GangwuGameData>(); _curHistoryItemInfo = new HistoryItemInfo { Users = new List <HistoryUserInfo>(), RoundVal = gdata.CurRound }; foreach (int seat in seatArray) { var userInfo = gdata.GetPlayerInfo(seat, true); if (userInfo != null) { HistoryUserInfo hui = new HistoryUserInfo { Seat = seat, UserInfo = userInfo, }; _curHistoryItemInfo.Users.Add(hui); } } }
/// <summary> /// 初始化单元信息 /// </summary> /// <param name="itemInfo"></param> public void InitItem(HistoryItemInfo itemInfo) { InitTurn(itemInfo.RoundVal); InitTime(itemInfo.Time); //先将所有的玩家信息隐藏 foreach (Transform child in _usersParent) { child.gameObject.SetActive(false); } List <HistoryUserInfo> userInfoList = itemInfo.Users; int count = userInfoList.Count; int setCount = (count - 1) / 3; _line1.gameObject.SetActive(setCount > 0); _backGround.height = 230 + setCount * 170; for (int i = 0; i < count; i++) //不对应座位号 { Transform child = _usersParent.GetChild(i); child.GetComponent <HistoryUser>().InitUser(userInfoList[i]); } }
public void Reset() { ItemList.Clear(); HistoryList.Clear(); _curHistoryItemInfo = new HistoryItemInfo(); }