public void UseItem() { currentSelectedSlot.item.amount--; inventory.OnUseItem(currentSelectedSlot.item); if (currentSelectedSlot.item.amount <= 0) { if (itemWindow.slots.Contains(currentSelectedSlot)) { itemWindow.slots.Remove(currentSelectedSlot); } Destroy(currentSelectedSlot.gameObject); if (itemWindow.slots.Count > 0) { SetSelectable(itemWindow.slots[0].gameObject); } } }
public virtual void UseItem() { inventory.OnUseItem(currentSelectedSlot.item); }