void UpdateBackPack_Size() { // 更新背包大小 GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack; m_BackPakcSize.text = string.Format("{0}/{1}", BackPack.GetItemCount(), BackPack.ContainerSize); }
// 更新回购槽 public void UpdateBuyBackItems() { if (null == GameManager.gameManager) { return; } // 根据回购背包数据更新回购槽 m_recycleGUIDList.Clear(); GameItemContainer buyBackPack = GameManager.gameManager.PlayerDataPool.BuyBackPack; int index = 0; if (buyBackPack == null) { return; } int count = buyBackPack.GetItemCount(); for (int i = 0; i < count; i++) { GameItem curItem = buyBackPack.GetItem(i); if (null != curItem && index < recycleItems.Length) { //sprRecycleSlots[index].gameObject.SetActive(true); m_recycleGUIDList.Add(curItem.Guid); int itemID = curItem.DataID; Tab_CommonItem curTabItem = TableManager.GetCommonItemByID(itemID, 0); if (null != curTabItem) { recycleItems[index].SetData(itemID, curItem.StackCount, true); index++; } } } for (int i = index; i < recycleItems.Length; i++) { recycleItems[i].SetData(-1, 0, true); } }
/// <summary> /// 更新背包部分显示 /// </summary> public void UpdateBackPack() { if (gameObject.activeSelf == false) { return; } //显示tab按钮高亮 //for (int i = 0; i < 5; ++i ) //{ // m_TabPage_HighLight[i].gameObject.SetActive(false); //} // int curTabIndex = (int)m_CurTabPage; //if ( curTabIndex >= 0 && curTabIndex < 5 ) //{ // m_TabPage_HighLight[curTabIndex].gameObject.SetActive(true); //} switch (m_CurTabPage) { case ITEM_TAB_PAGE.TAB_PAGE_ALL: ShowBackPack_All(); break; case ITEM_TAB_PAGE.TAB_PAGE_EQUIP: ShowBackPack_Equip(); break; case ITEM_TAB_PAGE.TAB_PAGE_MATERIAL: ShowBackPack_Material(); break; case ITEM_TAB_PAGE.TAB_PAGE_FELLOW: ShowBackPack_Fellow(); break; case ITEM_TAB_PAGE.TAB_PAGE_OTHER: ShowBackPack_Other(); break; } ; // 更新背包大小 GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack; m_BackPakcSize.text = string.Format("{0}/{1}", BackPack.GetItemCount(), BackPack.ContainerSize); }