private void OnDestroy() { if (_instance == this) { _instance = null; onScreenResize = null; } }
private void Awake() { if (_instance == null) { _instance = this; _instance.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy; StoreScreenSize(); } else { StoreScreenSize(); DestroyImmediate(this); } }