private void Awake() { ForegroundInvoker.Initialize().transform.parent = this.transform; ForegroundProcessor.Initialize().transform.parent = this.transform; BackgroundProcessor.Initialize(); DontDestroyOnLoad(this.gameObject); }
/// <summary> /// 初始化 /// </summary> /// <returns></returns> internal static GameObject Initialize() { if (g_instance != null) { return(g_instance.gameObject); } GameObject gObject = new GameObject(); gObject.name = "ForegroundInvoker"; g_instance = gObject.AddComponent <ForegroundInvoker>(); return(gObject); }
private void OnApplicationQuit() { ForegroundInvoker.Exit(); ForegroundProcessor.Exit(); BackgroundProcessor.Exit(); }