示例#1
0
        public void FillItem(object data)
        {
            _data      = data as PachinkoData;
            _pachinko  = new Pachinko();
            this.index = _data.index;

            if (_data.OwnerUserId == Player.Inst.UserData.UserId)
            {
                this.SetState(PachinkoStateType.Owned);
            }
            else
            {
                this.SetState(_data.StateType);
            }
            this.SetDisplay();
            this.SetBtnEvent();
            Debug.Log("ItemMain index: " + _data.index);
        }
示例#2
0
        private List <List <PachinkoData> > Pack(List <Easy.FrameUnity.ESNetwork.PachinkoData> dataList)
        {
            var datas        = new List <List <PachinkoData> >();
            var dataListTemp = new List <Easy.FrameUnity.ESNetwork.PachinkoData>(dataList);
            var line         = Math.Ceiling((float)dataList.Count / 2);

            Debug.Log("Line: " + line);
            int index = 0;

            for (int i = 0; i < line; i++)
            {
                var temp = new List <PachinkoData>();
                for (int j = 0; j < 2; j++)
                {
                    if (index > dataList.Count - 1)
                    {
                        continue;
                    }
                    var resData = dataListTemp[0];
                    var data    = new PachinkoData();
                    data.Id        = resData.Id;
                    data.index     = index;
                    data.StateType = resData.StateType;
                    data.Times     = resData.Times;
                    data.Sum       = resData.Sum;
                    data.PbChange  = resData.PbChange;
                    data.Award     = resData.Award;
                    data.Type      = resData.Type;
                    dataListTemp.RemoveAt(0);
                    temp.Add(data);
                    index++;
                }
                datas.Add(temp);
            }
            return(datas);
        }