private static ApplicationBehaviour CreateSingleton() { if (!Application.isPlaying) { Debug.LogWarning("ApplicationBehaviour doesn't work at edit time."); return(null); } instanceCache = new GameObject("ApplicationBehaviour").AddComponent <ApplicationBehaviour>(); instanceCache.gameObject.hideFlags = HideFlags.DontSave; DontDestroyOnLoad(instanceCache.gameObject); return(instanceCache); }
private void OnDestroy() { instanceCache = null; }
private void OnDestroy() { singleton = null; }