Пример #1
0
        /// <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;
            }
        }
Пример #2
0
        private void showStatusBalloon()
        {
            ShutdownType s = mainInterface1.ShutdownType;

            notifyIcon1.BalloonTipText = "Time remaining to " + s.ToString() + ": " + TimeInterpreter.TimeRemaining(shutdown.ShutdownTimer.Interval, tick);
            notifyIcon1.ShowBalloonTip(500);
        }
Пример #3
0
        /// <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;
            }
        }
Пример #4
0
        public static void Shutdown(ShutdownType shutdownType)
        {
            Log.Info("Shutdown Game Framework ({0})...", shutdownType.ToString());
            BaseComponent baseComponent = GetComponent <BaseComponent>();

            if (baseComponent != null)
            {
                //baseComponent.
            }
        }
Пример #5
0
        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()}");
                }
            }
        }
Пример #6
0
        /// <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();
            }
        }
Пример #7
0
        /// <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;
            }
        }
Пример #8
0
 public override string ToString()
 {
     return("Type: " + type.ToString() + " Interval: " + interval.ToString() + "\n");
 }