Exemple #1
0
        private void OnGetRecordInfo(object data)
        {
            if (data == null)
            {
                return;
            }
            var dataDic = (List <object>)data;
            List <RecordData> records = new List <RecordData>();
            int i = 0;

            foreach (var item in dataDic)
            {
                RecordData rd = new RecordData();
                rd.Parse(i, (IDictionary)item);
                records.Add(rd);
                i++;
            }
            Init(records);
            SetOrder((int)YxWindowManager.YxWinLayer.WindowLayer);
        }
Exemple #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="data"></param>
        public void Init(RecordData data)
        {
            _data = data;
            for (int i = 0; i < 4; i++)
            {
                if (_data.PlayersData.Length > i && _data.PlayersData[i] != null)
                {
                    _players[i].gameObject.SetActive(true);
                    _players[i].SetData(_data.PlayersData[i], false);
                }
                else
                {
                    _players[i].gameObject.SetActive(false);
                }
            }

            for (int i = 0; i < _lines.Length; i++)
            {
                _lines[i].SetActive(i + 1 < _data.PlayersData.Length);
            }

            List <object> replays = _data.ReplayDatas;

            for (int i = 0; i < replays.Count; i++)
            {
                RecordSingleRoundItem gob = NGUITools.AddChild(_replayGrid.gameObject, _replayBtnItem).GetComponent <RecordSingleRoundItem>();
                gob.Init(i, (Dictionary <string, object>)replays[i], _data.WebHost);
                UIEventListener.Get(gob.gameObject).onClick = OnClickReplay;
            }

            _roomType.text             = "[f27c7c]开房模式[-]";
            _replayGrid.repositionNow  = true;
            _linesGrid.repositionNow   = true;
            _playersGrid.repositionNow = true;
            _date.text     = _data.Time;
            _recordId.text = (_data.Index + 1).ToString();
        }