private static void Init() { if (!XTaskManager.IsInit) { XTaskManager.IsInit = true; XTaskManager._instance = (Object.FindObjectOfType(typeof(XTaskManager)) as XTaskManager); if (!XTaskManager._instance) { GameObject gameObject = new GameObject("XTaskManager"); Object.DontDestroyOnLoad(gameObject); XTaskManager._instance = gameObject.AddComponent <XTaskManager>(); } else { Object.DontDestroyOnLoad(XTaskManager._instance); } } }
private void OnApplicationQuit() { XTaskManager._instance = null; }