Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
j-weissen 2022-05-20 08:58:23 +02:00
commit 35f93ed50c
2 changed files with 7 additions and 8 deletions

View file

@ -22,8 +22,8 @@ public class Inventory : MonoBehaviour {
public Item[] startItems;
public const int inventorySpace = 28;
public delegate void onItemChanged();
public onItemChanged onItemChangedCallback;
public delegate void OnItemChanged();
public OnItemChanged onItemChangedCallback;
private void Start() {
items ??= new Dictionary<Item, int>();
@ -38,8 +38,6 @@ public class Inventory : MonoBehaviour {
return;
}
Debug.Log("ASDADADWDASDWD");
if(!items.ContainsKey(item)) {
items.Add(item, amount);
} else {
@ -51,7 +49,11 @@ public class Inventory : MonoBehaviour {
}
public void RemoveItem(Item item, int amount) {
items.Add(item, -amount);
if(items[item] <= 0) {
items.Remove(item);
} else {
items.Add(item, -amount);
}
onItemChangedCallback?.Invoke();
}

View file

@ -1,8 +1,5 @@
using System;
using Items.TerraformingTools;
using UnityEngine;
namespace Tiles
{
public abstract class BaseTile