private void AddItemToInventory(GameObject item, InventoryButton.ItemType type, int pos) { Button tempB = Instantiate(inventoryButton, inventoryPanel.transform); tempB.GetComponent <InventoryButton>().type = type; tempB.GetComponent <InventoryButton>().itemIdx = pos; tempB.onClick.AddListener(() => tempB.GetComponent <InventoryButton>().ActivateButton()); tempB.image.sprite = item.GetComponent <SpriteRenderer>().sprite; }
public void RemoveInventoryItem(string i, InventoryButton.ItemType type) { Items.Remove(i); UpdateInventoryUI(); }
public void AddInventoryItem(string i, InventoryButton.ItemType type) { Items.Add(i, type); UpdateInventoryUI(); }