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="index"></param> public void RemoveItem(int index) { yuan.YuanMemoryDB.YuanTable yTable = AuctionCompany.auctionCompany.auctionTable; yuan.YuanMemoryDB.YuanRow yRow = yTable.SelectRowEqual("id", index.ToString()); if (null == yRow) { return; } yTable.Rows.Remove(yRow); m_scrollView.UpdateListItem(AuctionCompany.auctionCompany.auctionTable.Rows.Count); aucTable = AuctionCompany.auctionCompany.auctionTable; }
/// <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); } } }