public static void Destroy() { if (mInstance != null) { Destroy(mInstance.gameObject); mInstance = null; } }
public static void Init() { if (mInstance == null) { mInstance = new GameObject("_LaunchCounter").AddComponent(typeof(LaunchCounter)) as LaunchCounter; DontDestroyOnLoad(mInstance.gameObject); //!!! mInstance.launchCount = PlayerPrefs.GetInt(User.CharacterName + "_countExitFromBg", 0); mInstance.launchCount++; } }