This commit is contained in:
Janis
2023-02-22 18:43:55 +01:00
parent 50916358f2
commit 5edcd3625b
17 changed files with 3234 additions and 18 deletions

View File

@@ -12,12 +12,15 @@ public class InventoryUI : GuiPanel
private void Start()
{
playerInventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();
Inventory.OnPlayerInventoryChanged += UpdateSlots;
CreateSlots();
}
public override void OnOpen()
{
if (slotUIList.Count == 0)
{
playerInventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();
CreateSlots();
}
UpdateSlots();
}