private void Awake() { if (instance == null) { instance = this; } else { DestroyImmediate(gameObject); } }
private void Awake() { InMenu = true; if (_instance != null && _instance != this) { Destroy(gameObject); return; } else { _instance = this; } instance = _instance; DontDestroyOnLoad(this); }