mirror of
https://github.com/DerTyp7/harvestdale-unity.git
synced 2025-10-30 13:07:10 +01:00
hotbar
This commit is contained in:
@@ -28,14 +28,13 @@ public class GuiManager : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
Destroy(this.gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +64,10 @@ public class GuiManager : MonoBehaviour
|
||||
{
|
||||
OpenPanel(panel);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Panel not found: " + name);
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenPanel(GuiPanel panel)
|
||||
@@ -73,7 +76,7 @@ public class GuiManager : MonoBehaviour
|
||||
if (!panel.gameObject.activeSelf)
|
||||
{
|
||||
panel.gameObject.SetActive(true);
|
||||
panel.OnClose();
|
||||
panel.OnOpen();
|
||||
Debug.Log("Open Panel");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user