29 lines
515 B
C#
29 lines
515 B
C#
using UnityEngine;
|
|
|
|
public class UIHandler : MonoBehaviour
|
|
{
|
|
public GameObject mainHUD;
|
|
|
|
public void OpenUI(UIObject targetUI)
|
|
{
|
|
if (targetUI.willCloseMainUI && mainHUD.activeSelf)
|
|
{
|
|
mainHUD.SetActive(false);
|
|
}
|
|
targetUI.gameObject.SetActive(true);
|
|
}
|
|
|
|
public void CloseUI(UIObject targetUI)
|
|
{
|
|
if (!mainHUD.activeSelf)
|
|
{
|
|
mainHUD.SetActive(true);
|
|
}
|
|
targetUI.gameObject.SetActive(false);
|
|
}
|
|
|
|
public void ExitGame()
|
|
{
|
|
//LevelSwitcher.instance.SwitchMenu(0); //replace with main menu
|
|
}
|
|
}
|