Пример #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
        /// <summary>
        /// 关闭游戏。
        /// </summary>
        public static void Shutdown()
        {
            Log.Info("Shutdown Game Framework...");
            BaseComponent baseComponent = GetComponent <BaseComponent>();

            if (baseComponent != null)
            {
                baseComponent.Shutdown();
            }

            s_GameFrameworkComponents.Clear();

            Application.Quit();
        }
Пример #3
0
        /// <summary>
        /// 重启游戏。
        /// </summary>
        public static void Restart()
        {
            Log.Info("Restart Game Framework...");
            BaseComponent baseComponent = GetComponent <BaseComponent>();

            if (baseComponent != null)
            {
                baseComponent.Shutdown();
            }

            s_GameFrameworkComponents.Clear();

            if (baseComponent != null)
            {
                baseComponent.Reload();
            }
        }
Пример #4
0
        public static void Shutdown(ShutdownType shutdownType)
        {
            BaseComponent baseComponent = GetComponent <BaseComponent>();

            if (baseComponent != null)
            {
                baseComponent.Shutdown();
                baseComponent = null;
            }

            s_GameFrameworkComponents.Clear();
            if (shutdownType == shutdownType.Quit)
            {
                Application.Quit();
#if UNITY_EDITOR
                EditorApplication.isPlaying = false;
#endif
                return;
            }
        }
Пример #5
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();
            }
        }