GuiManager

This commit is contained in:
Janis
2023-02-22 14:23:26 +01:00
parent a2e4459b5c
commit 50916358f2
8 changed files with 212 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InventoryUI : MonoBehaviour
public class InventoryUI : GuiPanel
{
[SerializeField] private GameObject slotPrefab;
[SerializeField] private GameObject slotListObj;
@@ -15,10 +15,16 @@ public class InventoryUI : MonoBehaviour
playerInventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();
Inventory.OnPlayerInventoryChanged += UpdateSlots;
CreateSlots();
}
public override void OnOpen()
{
UpdateSlots();
}
public override void OnClose()
{
}
private void CreateSlots()
{
playerInventory = GameObject.FindGameObjectWithTag("Player").GetComponent<Inventory>();