Exemplo n.º 1
0
        public void OnGetRecordInfo(object data)
        {
            if (data == null)
            {
                return;
            }

            var dataDic = (List <object>)data;
            List <DbsmjRecordData> records = new List <DbsmjRecordData>();

            foreach (var item in dataDic)
            {
                DbsmjRecordData rd = new DbsmjRecordData();
                rd.Parse(itemIndex, (IDictionary)item, gk);
                records.Add(rd);
                itemIndex++;
            }

            InitForDbsmj(records);
            SetOrder((int)YxWindowManager.YxWinLayer.WindowLayer);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="data"></param>
        public void Init(DbsmjRecordData data)
        {
            _data = data;
            for (int i = 0; i < _players.Length; 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);
                }
            }

            List <object> replays = _data.ReplayDatas;

            if (Flag(data.GameKey))
            {
                int index = replays.Count;

                for (int i = 0; i < replays.Count; i++)
                {
                    RecordSingleRoundItem gob = NGUITools.AddChild(_replayGrid.gameObject, _replayBtnItem).GetComponent <RecordSingleRoundItem>();
                    gob.Init(index--, (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();
        }