Esempio n. 1
0
 public void RefreshDisplay()
 {
     RemoveButtons();
     foreach (Item item in PlayerInventory)
     {
         if (item.MarkedForDelete)
         {
             RemoveItem(item.ItemName);
             continue;
         }
         GameObject newItem = ItemBtnPool.GetObject();
         newItem.transform.SetParent(InventoryContent);
         InventoryLabels inventoryLabel = newItem.GetComponent <InventoryLabels>();
         inventoryLabel.Setup(item);
     }
 }
Esempio n. 2
0
    public void OpenInventory()
    {
        if (InventoryPanel.activeSelf)
        {
            return;
        }
        RefreshDisplay();
        RemoveButtons();

        foreach (Item item in PlayerInventory)
        {
            if (item.MarkedForDelete)
            {
                RemoveItem(item.ItemName);
                continue;
            }
            GameObject newItem = ItemBtnPool.GetObject();
            newItem.transform.SetParent(InventoryContent);
            InventoryLabels inventoryLabel = newItem.GetComponent <InventoryLabels>();
            inventoryLabel.Setup(item);
            newItem.GetComponent <RectTransform>().localScale = btnPrefab.GetComponent <RectTransform>().localScale;
        }
        InventoryPanel.gameObject.SetActive(true);
    }