Пример #1
0
        public void Initialize(SimulationManager.UpdateMode _updateMode)
        {
            updateMode = _updateMode;

            if (!loggingInitialized)
            {
                Application.logMessageReceived += (condition, trace, type) =>
                {
                    if (!logExceptionsToConsole)
                    {
                        return;
                    }

                    if (Instance.console != null)
                    {
                        Instance.console.AddMessage(String.Format("{0} ({1})", condition, trace), type, true);
                        return;
                    }

                    if (type == LogType.Error || type == LogType.Exception || type == LogType.Assert)
                    {
                        Log.Error(condition);
                    }
                    else if (type == LogType.Warning)
                    {
                        Log.Warning(condition);
                    }
                    else
                    {
                        Log.Message(condition);
                    }
                };

                loggingInitialized = true;
            }

            sceneExplorer = gameObject.AddComponent<SceneExplorer>();
            watches = gameObject.AddComponent<Watches>();
            colorPicker = gameObject.AddComponent<ColorPicker>();

            sceneExplorerColorConfig = gameObject.AddComponent<SceneExplorerColorConfig>();

            LoadConfig();

            if (extendGamePanels && (updateMode == SimulationManager.UpdateMode.NewGame || updateMode == SimulationManager.UpdateMode.LoadGame))
            {
                panelExtender = gameObject.AddComponent<GamePanelExtender>();
            }

            if (useModToolsConsole)
            {
                console = gameObject.AddComponent<Console>();
            }

            if (config.hookUnityLogging)
            {
                UnityLoggingHook.EnableHook();
            }

            if (updateMode == SimulationManager.UpdateMode.Undefined && config.improvedWorkshopIntegration)
            {
                ImprovedWorkshopIntegration.Bootstrap();
            }
        }
Пример #2
0
        public void Initialize(SimulationManager.UpdateMode _updateMode)
        {
            updateMode = _updateMode;

            if (!loggingInitialized)
            {
                Application.logMessageReceived += (condition, trace, type) =>
                {
                    if (!logExceptionsToConsole)
                    {
                        return;
                    }

                    if (Instance.console != null)
                    {
                        Instance.console.AddMessage(String.Format("{0} ({1})", condition, trace), type, true);
                        return;
                    }

                    if (type == LogType.Error || type == LogType.Exception || type == LogType.Assert)
                    {
                        Log.Error(condition);
                    }
                    else if (type == LogType.Warning)
                    {
                        Log.Warning(condition);
                    }
                    else
                    {
                        Log.Message(condition);
                    }
                };

                loggingInitialized = true;
            }

            sceneExplorer = gameObject.AddComponent <SceneExplorer>();
            watches       = gameObject.AddComponent <Watches>();
            colorPicker   = gameObject.AddComponent <ColorPicker>();

            sceneExplorerColorConfig = gameObject.AddComponent <SceneExplorerColorConfig>();

            LoadConfig();

            if (extendGamePanels && (updateMode == SimulationManager.UpdateMode.NewGame || updateMode == SimulationManager.UpdateMode.LoadGame))
            {
                panelExtender = gameObject.AddComponent <GamePanelExtender>();
            }

            if (useModToolsConsole)
            {
                console = gameObject.AddComponent <Console>();
            }

            if (config.hookUnityLogging)
            {
                UnityLoggingHook.EnableHook();
            }

            if (updateMode == SimulationManager.UpdateMode.Undefined && config.improvedWorkshopIntegration)
            {
                ImprovedWorkshopIntegration.Bootstrap();
            }
        }