Merge branch 'develop' into dhain

# Conflicts:
#	Assets/Scripts/ShopSlot.cs
This commit is contained in:
dhain 2022-06-02 15:09:49 +02:00
commit 6959240afe
4 changed files with 824 additions and 13 deletions

View file

@ -32,14 +32,14 @@ public class ShopSlot : ItemStorageSlot {
/**
* Gets called when the Shop Slot is clicked
*/
public override void UseItem() {
if(_playerController.money >= Item.cost) {
_inventory.AddItem(Item, 1);
_shop.RemoveItem(Item, 1);
_playerController.money -= Item.cost;
public void UseItem() {
if(_playerController.Money >= item.cost) {
_inventory.AddItem(item, 1);
_shop.RemoveItem(item, 1);
_playerController.ChangeMoney(-item.cost);
Debug.Log("Buying Item: " + Item.displayName);
Debug.Log("money left: " + _playerController.money);
Debug.Log("Buying Item: " + item.displayName);
Debug.Log("money left: " + _playerController.Money);
} else {
Debug.Log("Not enough money to buy item.");
}