/// <summary>
        /// 放于游戏开始交互,记录参与游戏的玩家信息
        /// </summary>
        /// <param name="seats"></param>
        public void CreateHistoryItem(int[] seats)
        {
            var gdata = App.GetGameData <DuifenGlobalData>();

            _curHistoryItemInfo = new HistoryItemInfo
            {
                Users    = new List <HistoryUserInfo>(),
                RoundVal = gdata.CurRound
            };

            foreach (int seat in seats)
            {
                var userInfo = gdata.GetPlayerInfo(seat);
                if (userInfo != null)
                {
                    HistoryUserInfo hui = new HistoryUserInfo
                    {
                        Seat     = seat,
                        UserInfo = userInfo,
                    };

                    _curHistoryItemInfo.Users.Add(hui);
                }
            }
        }
Exemple #2
0
        public void InitItem(HistoryItemInfo itemInfo)
        {
            List <HistoryUserInfo> userInfoList = itemInfo.Users;

            //先将所有的玩家信息隐藏
            foreach (Transform child in _usersParent)
            {
                child.gameObject.SetActive(false);
            }


            int count = userInfoList.Count;

            for (int i = 0; i < count; i++)            //不对应座位号
            {
                Transform child = _usersParent.GetChild(i);
                child.GetComponent <HistoryUser>().InitUser(userInfoList[i]);
                child.gameObject.SetActive(true);
            }

            _usersParent.GetComponent <UIGrid>().Reposition();
            InitTurn(itemInfo.RoundVal);
            InitTime(itemInfo.Time);
        }
 public void Reset()
 {
     ItemList.Clear();
     HistoryList.Clear();
     _curHistoryItemInfo = new HistoryItemInfo();
 }