Esempio n. 1
0
        /// <summary>
        /// 初始化新增负债的数据
        /// </summary>
        /// <param name="go"></param>
        private void _CreateWrapGrid(GameObject go)
        {
            var items = _controller.GetPaybackList();

            Console.WriteLine("当前的还款个数" + items.Count.ToString());

            if (null == _wrapGrid)
            {
                if (items.Count <= 0)
                {
                    go.SetActiveEx(false);
                    return;
                }

                _wrapGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _wrapGrid.Cells.Length; ++i)
                {
                    var cell = _wrapGrid.Cells[i];
                    cell.DisplayObject = new UIBorrowPayBackItem(cell.GetTransform().gameObject);
                }

                _wrapGrid.OnRefreshCell += _OnRefreshCell;
            }
            else
            {
                _wrapGrid.GridSize = items.Count;
            }
            _wrapGrid.Refresh();
        }
Esempio n. 2
0
        private void _CreateAddPayGrid(GameObject go)
        {
            var items = _controller.GetPaybackList();

            if (items.Count <= 0)
            {
                go.SetActive(false);
                return;
            }
            else
            {
                go.SetActive(true);
            }

            if (null == _addDebtGrid)
            {
                _addDebtGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _addDebtGrid.Cells.Length; ++i)
                {
                    var cell = _addDebtGrid.Cells[i];
                    cell.DisplayObject = new UIInforAddDebtItem(cell.GetTransform().gameObject);
                }

                _addDebtGrid.OnRefreshCell += _OnRefreshCell;
            }
            else
            {
                _addDebtGrid.GridSize = items.Count;
            }

            _addDebtGrid.Refresh();
        }
Esempio n. 3
0
        private void _CreateWrapGridForSale(GameObject go)
        {
            if (_controller.TotalGameRecord.totalNums <= 0 || _controller.GetGameDataList.Count <= 0)
            {
                this.scrollView.SetActiveEx(false);
                this.textNoRecord.SetActiveEx(true);
                return;
            }


            var items = _controller.GetGameDataList;

            if (items.Count <= 0)
            {
                go.SetActive(false);
                return;
            }
            else
            {
                go.SetActive(true);
            }

            _saleWrapGrid = new UIWrapGrid(go, items.Count);
            for (var i = 0; i < _saleWrapGrid.Cells.Length; i++)
            {
                var cell = _saleWrapGrid.Cells[i];
                cell.DisplayObject = new PersonalItem(cell.GetTransform().gameObject);
            }
            _saleWrapGrid.OnRefreshCell += _OnRefreshCell;
            _saleWrapGrid.Refresh();
        }
Esempio n. 4
0
        /// <summary>
        /// 初始化基本负债的数据
        /// </summary>
        /// <param name="go"></param>
        private void _CreateBasePayGrid(GameObject go)
        {
            var items = _controller.GetBasePayBackList();

            if (null == _basePayGrid)
            {
                if (items.Count <= 0)
                {
                    go.SetActive(false);
                    return;
                }

                _basePayGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _basePayGrid.Cells.Length; ++i)
                {
                    var cell = _basePayGrid.Cells[i];
                    cell.DisplayObject = new UIBorrowBasePayItem(cell.GetTransform().gameObject);
                }

                _basePayGrid.OnRefreshCell += _OnRefreshBasePayCell;
            }
            else
            {
                _basePayGrid.GridSize = items.Count;
            }
            _basePayGrid.Refresh();
        }
Esempio n. 5
0
        private void _CreateWrapGrid(GameObject go)
        {
            var items = _controller.GetDataList();

            _wrapGrid = new UIWrapGrid(go, items.Count);

            for (int i = 0; i < _wrapGrid.Cells.Length; ++i)
            {
                var cell = _wrapGrid.Cells[i];
                cell.DisplayObject = new ItemDisplay(cell.GetTransform().gameObject);
            }

            _wrapGrid.OnRefreshCell += _OnRefreshCell;
            _wrapGrid.Refresh();
        }
Esempio n. 6
0
        private void _CreateChatGrid(GameObject go)
        {
            var items = _controller.GetChatList();

//			Console.Warning.WriteLine ("当前数组的长度是:"+items.Count.ToString());

            if (items.Count <= 0)
            {
                go.SetActive(false);
                return;
            }
            else
            {
                go.SetActive(true);
            }

            if (null == _chatGrid)
            {
                _chatGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _chatGrid.Cells.Length; ++i)
                {
                    var cell = _chatGrid.Cells[i];
                    cell.DisplayObject = new UIBattleChatItem(cell.GetTransform().gameObject);
                }
                _chatGrid.OnRefreshCell += _OnRefreshCell;
            }
            else
            {
                _chatGrid.GridSize = items.Count;
            }
            //			_chatGrid.Cells.GetUpperBound(items.Count-1);
            _chatGrid.Refresh();

            if (_chatGridRect.verticalNormalizedPosition > 0.3f)
            {
                _chatGridRect.verticalNormalizedPosition = 0.05f;
            }
            else
            {
                _chatGridRect.verticalNormalizedPosition = 0;
            }

//			_chatGridRect.verticalNormalizedPosition=0;
        }
Esempio n. 7
0
        private void _CreateAddPayGrid(GameObject go)
        {
            var items = _controller.GetChatList();

            if (items.Count <= 0)
            {
                go.SetActive(false);
                return;
            }
            else
            {
                go.SetActive(true);
            }

            if (null == _chatGrid)
            {
                _chatGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _chatGrid.Cells.Length; i++)
                {
                    var cell = _chatGrid.Cells[i];
                    cell.DisplayObject = new UIFightChatItem(cell.GetTransform().gameObject);
                }
                _chatGrid.OnRefreshCell += _OnRefreshCell;
            }
            else
            {
                _chatGrid.GridSize = items.Count;
            }
            //			_chatGrid.Cells.GetUpperBound(items.Count-1);
            _chatGrid.Refresh();

            if (_scrollRect.verticalNormalizedPosition > 0.3f)
            {
                _scrollRect.verticalNormalizedPosition = 0.05f;
            }
            else
            {
                _scrollRect.verticalNormalizedPosition = 0;
            }
//			_scrollRect.verticalNormalizedPosition=0;
        }
Esempio n. 8
0
        private void _CreateQualityWrapGrid(GameObject go)
        {
            var items = _controller.GetQualityScoreList();

            if (null == _qualityWrapGrid)
            {
                _qualityWrapGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _qualityWrapGrid.Cells.Length; ++i)
                {
                    var cell = _qualityWrapGrid.Cells[i];
                    cell.DisplayObject = new UIQualityRecordItem(cell.GetTransform().gameObject);
                }
                _qualityWrapGrid.OnRefreshCell += _OnRefreshQualityCell;
            }
            else
            {
                _qualityWrapGrid.GridSize = items.Count;
            }
            _qualityWrapGrid.Refresh();
        }
Esempio n. 9
0
        private void _CreateWrapGrid(GameObject go)
        {
            var items = _controller.GetDataList();

            _wrapGrid = new UIWrapGrid(go, items.Count);

            for (int i = 0; i < _wrapGrid.Cells.Length; ++i)
            {
                var cell = _wrapGrid.Cells[i];

                var tmpChangeItem = new UIShareChangeItem(cell.GetTransform().gameObject);

                cell.DisplayObject = tmpChangeItem;
                if (i == 0)
                {
                    tmpChangeItem.InitSelected();
                }
            }

            _wrapGrid.OnRefreshCell += _OnRefreshCell;
            _wrapGrid.Refresh();
        }
Esempio n. 10
0
        /**
         * 初始化卖卡牌的数据**/
        private void _CreateWrapGrid(GameObject go)
        {
            //if(_wrapGrid!=null)
            //{
            // return;
            //}
            //Console.Error.WriteLine("当前实例化素组啦-----:");
            if (_wrapGrid == null)
            {
                var items = _controller.GetDataList();
                _wrapGrid = new UIWrapGrid(go, items.Count);
                for (int i = 0; i < _wrapGrid.Cells.Length; ++i)
                {
                    var cell          = _wrapGrid.Cells[i];
                    var tmpChangeItem = new UIShareChangeItem(cell.GetTransform().gameObject);

                    cell.DisplayObject = tmpChangeItem;
                    if (i == 0)
                    {
                        tmpChangeItem.InitSelected();
                    }
                }
                _wrapGrid.OnRefreshCell += _OnRefreshCell;
                _wrapGrid.Refresh();
            }
            else
            {
                for (int i = 0; i < _wrapGrid.Cells.Length; ++i)
                {
                    var cell = _wrapGrid.Cells[i];

                    if (i < _controller.GetDataList().Count)
                    {
                        _OnRefreshCell(cell);
                    }
                }
            }
        }
Esempio n. 11
0
        private void _CreateWrapGridForSale(GameObject go)
        {
            var items = _controller.GetSaleRecordList();

            if (items.Count <= 0)
            {
                go.SetActive(false);
                return;
            }
            else
            {
                go.SetActive(true);
            }

            _saleWrapGrid = new UIWrapGrid(go, items.Count);
            for (var i = 0; i < _saleWrapGrid.Cells.Length; i++)
            {
                var cell = _saleWrapGrid.Cells [i];
                cell.DisplayObject = new UISaleRecordItem(cell.GetTransform().gameObject);
            }
            _saleWrapGrid.OnRefreshCell += _OnRefreshCell;
            _saleWrapGrid.Refresh();
        }
Esempio n. 12
0
        private void _CreateIncomeWrapGrid(GameObject go)
        {
            var items = _controller.GetIncomeList();

            if (null == _incomeWrapGrid)
            {
                _incomeWrapGrid = new UIWrapGrid(go, items.Count);

                for (int i = 0; i < _incomeWrapGrid.Cells.Length; ++i)
                {
                    var cell = _incomeWrapGrid.Cells[i];
                    cell.DisplayObject = new UIIncomeRecordInforItem(cell.GetTransform().gameObject);
                }

                _incomeWrapGrid.OnRefreshCell += _OnRefreshIncomeCell;
            }
            else
            {
                _incomeWrapGrid.GridSize = items.Count;
            }


            _incomeWrapGrid.Refresh();
        }
Esempio n. 13
0
 public UIWrapGridCell(UIWrapGrid wrapGrid, GameObject cellPrefab)
 {
     _wrapGrid  = wrapGrid;
     _transform = cellPrefab.transform;
 }