public void InitItemGrid() { m_scrollView = grid.transform.GetComponent <LoopScrollView>(); m_scrollView.Init(true); int count = 0; string[] tempItems = null; //if (itemList.TryGetValue(currLayer, out tempItems)) //{ // count = tempItems.Length; //} if (itemList.TryGetValue(maxTowerLevel, out tempItems)) { count = tempItems.Length; } m_scrollView.UpdateListItem(count); m_scrollView.SetDelegate(UpdateItemInfo, null); //yield return new WaitForSeconds(1.0f); for (int i = 0; i < grid.transform.childCount; i++) { UpdateItemInfo(grid.transform.GetChild(i).gameObject); } }
/// <summary> /// 初始化列表,显示拍卖信息 /// </summary> /// <param name="tempTable"></param> public void ShowAuctionItems(yuan.YuanMemoryDB.YuanTable tempTable) { EnableGrid(true); m_scrollView = itemGrid.transform.GetComponent <LoopScrollView>(); m_scrollView.Init(true); m_scrollView.UpdateListItem(tempTable.Rows.Count); m_scrollView.SetDelegate(UpdateItemInfo, ItemOnClick); aucTable = tempTable; for (int i = 0; i < itemGrid.transform.childCount; i++) { if (tempTable.Rows.Count != 0 && i <= tempTable.Rows.Count) { UpdateItemInfo(itemGrid.transform.GetChild(i).gameObject); } } }