/// <summary> /// 关闭游戏框架。 /// </summary> /// <param name="shutdownType">关闭游戏框架类型。</param> public static void Shutdown(ShutdownType shutdownType) { Log.Info("Shutdown Game Framework ({0})...", shutdownType.ToString()); BaseComponent baseComponent = GetComponent <BaseComponent>(); if (baseComponent != null) { baseComponent.Shutdown(); baseComponent = null; } s_GameFrameworkComponents.Clear(); if (shutdownType == ShutdownType.None) { return; } if (shutdownType == ShutdownType.Restart) { SceneManager.LoadScene(GameFrameworkSceneId); return; } if (shutdownType == ShutdownType.Quit) { Application.Quit(); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif return; } }
private void showStatusBalloon() { ShutdownType s = mainInterface1.ShutdownType; notifyIcon1.BalloonTipText = "Time remaining to " + s.ToString() + ": " + TimeInterpreter.TimeRemaining(shutdown.ShutdownTimer.Interval, tick); notifyIcon1.ShowBalloonTip(500); }
/// <summary> /// 关闭游戏框架 /// </summary> /// <param name="shutdownType">关闭游戏框架类型</param> public static void Shutdown(ShutdownType shutdownType) { Log.Info("[GameEntry.Shutdown] Shutdown Game Frame ({0})...", shutdownType.ToString()); BaseComponent baseComponent = GetComponent <BaseComponent>(); if (baseComponent != null) { baseComponent.Shutdown(); baseComponent = null; } s_GFComponents.Clear(); //清空组件 switch (shutdownType) { case ShutdownType.None: break; case ShutdownType.Restart: SceneManager.LoadScene(GFSceneId); break; case ShutdownType.Quit: Application.Quit(); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif break; default: break; } }
public static void Shutdown(ShutdownType shutdownType) { Log.Info("Shutdown Game Framework ({0})...", shutdownType.ToString()); BaseComponent baseComponent = GetComponent <BaseComponent>(); if (baseComponent != null) { //baseComponent. } }
private static void WriteLogInFile(ShutdownType shutdownType, ShutdownOptions shutdownOptions, string pathToLogDirectory) { if (!string.IsNullOrEmpty(pathToLogDirectory)) { var filePath = $@"{pathToLogDirectory}\{DateTime.Now.ToString("dd-MM-yyyy")}.log"; //path to log file if (!File.Exists(filePath)) //if file is not exists { var createdFile = File.Create(filePath); //create it createdFile.Close(); //close created file to free process } using (var textWriter = new StreamWriter(filePath)) { textWriter.WriteLine($"{DateTime.Now} - {shutdownType.ToString()} - {shutdownOptions.ToString()}"); } } }
/// <summary> /// 关闭游戏框架。 /// </summary> /// <param name="shutdownType">关闭游戏框架类型。</param> public static void Shutdown(ShutdownType shutdownType) { Log.Info("Shutdown Game Framework ({0})...", shutdownType.ToString()); BaseComponent baseComponent = GetComponent <BaseComponent>(); if (baseComponent != null) { baseComponent.Shutdown(); } s_GameFrameworkComponents.Clear(); if (shutdownType == ShutdownType.Quit) { Application.Quit(); } else if (shutdownType == ShutdownType.Restart && baseComponent != null) { baseComponent.Reload(); } }
/// <summary> /// 关闭游戏 /// </summary> /// <param name="shutdownType">关闭游戏类型</param> public static void Shutdown(ShutdownType shutdownType) { Log.Info("Shutdown ({0})...", shutdownType.ToString()); if (shutdownType == ShutdownType.None) { return; } if (shutdownType == ShutdownType.Restart) { SceneManager.LoadScene(SceneId); return; } if (shutdownType == ShutdownType.Quit) { Application.Quit(); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif return; } }
public override string ToString() { return("Type: " + type.ToString() + " Interval: " + interval.ToString() + "\n"); }