private void OnDestroy() { if (_instance == this) { _instance = null; } }
private void Awake() { if (_instance != this && _instance != null) { Destroy(gameObject); return; } if (_instance == null) { _instance = this; return; } if (_instance == this) { throw new Exception($"Why am I added two times?"); } }