24 lines
435 B
C#
24 lines
435 B
C#
using UnityEngine;
|
|
|
|
public sealed class GlobalUIController : MonoBehaviour
|
|
{
|
|
public static GlobalUIController Instance { get; private set; }
|
|
|
|
private void Awake()
|
|
{
|
|
if (Instance != null && Instance != this)
|
|
{
|
|
Destroy(gameObject);
|
|
return;
|
|
}
|
|
|
|
Instance = this;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
if (Instance == this)
|
|
Instance = null;
|
|
}
|
|
}
|