you can now undo a purchase after buying an item from the shop

This commit is contained in:
d-hain 2022-06-08 21:47:00 +02:00
parent efc7a3deaf
commit 64b25a2029
12 changed files with 359 additions and 56 deletions

View file

@ -5,11 +5,13 @@ public class InventorySlot : ItemStorageSlot {
* Gets called when the Inventory Slot is clicked
*/
public override void UseItem() {
if(Item.GetType() == typeof(UsableItem)) {
((UsableItem) Item).Select();
Debug.Log("using " + Item.displayName);
} else {
Debug.Log("Item not usable " + Item.displayName);
if(Item){
if(Item.GetType() == typeof(UsableItem)) {
((UsableItem)Item).Select();
Debug.Log("using " + Item.displayName);
} else {
Debug.Log("Item not usable " + Item.displayName);
}
}
}
}