Example #1
0
    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;
    }
Example #2
0
 public void RemoveInventoryItem(string i, InventoryButton.ItemType type)
 {
     Items.Remove(i);
     UpdateInventoryUI();
 }
Example #3
0
 public void AddInventoryItem(string i, InventoryButton.ItemType type)
 {
     Items.Add(i, type);
     UpdateInventoryUI();
 }