コード例 #1
0
        public void Initialize()
        {
            if (!loggingInitialized)
            {
                Application.logMessageReceivedThreaded += OnApplicationLogMessageReceivedThreaded;

                loggingInitialized = true;
            }

            sceneExplorer            = gameObject.AddComponent <SceneExplorer>();
            watches                  = gameObject.AddComponent <Watches>();
            colorPicker              = gameObject.AddComponent <ColorPicker>();
            scriptEditor             = gameObject.AddComponent <ScriptEditor>();
            scriptEditor.visible     = false;
            sceneExplorerColorConfig = gameObject.AddComponent <SceneExplorerColorConfig>();

            LoadConfig();

            if (config.useModToolsConsole)
            {
                console = gameObject.AddComponent <Console>();
            }
        }
コード例 #2
0
        public void Initialize()
        {
            if (!loggingInitialized)
            {
                Application.logMessageReceivedThreaded += OnApplicationLogMessageReceivedThreaded;

                loggingInitialized = true;
            }

            SceneExplorer    = gameObject.AddComponent <SceneExplorer>();
            Watches          = gameObject.AddComponent <Watches>();
            ColorPicker      = gameObject.AddComponent <ColorPicker>();
            scriptEditor     = gameObject.AddComponent <ScriptEditor>();
            appearanceConfig = gameObject.AddComponent <AppearanceConfig>();

            LoadConfig();

            if (Config.UseModToolsConsole)
            {
                console = gameObject.AddComponent <CustomConsole>();
                Logger.SetCustomLogger(console);
            }
        }
コード例 #3
0
ファイル: ModTools.cs プロジェクト: Rychard/Skylines-ModTools
        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();
            }
        }
コード例 #4
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();
            }
        }