private void OnDestroy() { if (_instance == this) { _instance = null; } }
private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; InitializeMenus(); DontDestroyOnLoad(gameObject); } }