Undo last purchase working again

Added Comments to AnimalShop, ItemShop and ShopUI classes
This commit is contained in:
d-hain 2022-06-23 22:24:22 +02:00
parent 441ffb900a
commit c01c592976
7 changed files with 25 additions and 194 deletions

View file

@ -16,8 +16,8 @@ namespace Shop {
}
/**
* Clears the Shop Slot
*/
* Clears the Shop Slot
*/
public override void ClearSlot() {
nameText.text = "";
costText.text = "";
@ -26,8 +26,8 @@ namespace Shop {
}
/**
* Gets called when the Shop Slot is clicked
*/
* Gets called when the Shop Slot is clicked
*/
public override void UseElement() {
if(Element) {
if(_playerController.Money >= Element.price) {
@ -36,7 +36,6 @@ namespace Shop {
_itemShop.itemWasBought = true;
// Debug.Log("Buying Item: " + Element.displayName);
}
_inventory.AddElement(Element, 1);
_itemShop.RemoveElement(Element, 1);
} else {