/// <summary> /// Ensure that there is an instance of this class somewhere in the scene. /// </summary> static void CreateInstance() { if (mInstance == null) { GameObject go = new GameObject("_UpdateManager"); mInstance = go.AddComponent<GUpdateManager>(); DontDestroyOnLoad(go); } }
void OnDestroy() { mInstance = null; }