Skip to content

Commit

Permalink
Items are now consumable from within inventory submenu
Browse files Browse the repository at this point in the history
  • Loading branch information
Papiertig0r committed Feb 4, 2018
1 parent eedf481 commit 59c4064
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Assets/Scripts/Ui/InventorySubmenuUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public void SetUp(Item item)
{
selectedButton = 0;
activeButtons.Clear();
this.item = item;

IConsumable consumable = item.GetComponent<IConsumable>();
if(consumable != null)
Expand Down Expand Up @@ -109,9 +110,11 @@ private void Update()

public void Consume()
{
//IConsumable consumable = item.GetComponent<IConsumable>();
//consumable.Consume(PlayerController.player);
Debug.Log("Clicked Consume");
Inventory inv = Inventory.instance;
Item item = inv.InstantiateItem(this.item);
IConsumable consumable = item.GetComponent<IConsumable>();
consumable.Consume(PlayerController.player);
inv.RemoveItem(inv.inventoryUi.GetSelectedSlot());
}

public void Mix()
Expand Down

0 comments on commit 59c4064

Please sign in to comment.