Skip to content

Console Settings

JTRB edited this page Feb 23, 2021 · 16 revisions

Overview

This package offers a variety of settings for you to customize and configure the console to fit your needs. You can access the settings by navigating to Window > Developer Console > Settings. This will create a new ScriptableObject in your project directory at Assets/Developer Console/Resources/ConsoleSettings.asset. Feel free to move the ScriptableObject around to suit your needs—it will automatically be located at runtime—just make sure you always keep it inside of a Resources folder so that it can be loaded in your built game. For more information on Unity resources, see the Unity manual. If a console settings ScriptableObject cannot be found (for instance, when running a built executable), default values will be used for each setting as listed below.

This page serves as an overview of all of the console's settings and what each setting does. Additionally, you can hover over any field in the settings window to get a brief description of that setting.

General Settings

Settings that are non-visual and affect the functionality or behavior of the developer console.

Setting Name API Name Description Default Value
Enabled ConsoleSettings.EnableConsole Determines if/when the console is enabled. For instance, if set to Always, the console would always be enabled; if set to Editor Only, the console will be enabled in the editor but not in the built executable, and so on. By disabling the console, large portions of the DeveloperConsole.* API are disabled. Always
Open Key ConsoleSettings.ConsoleOpenKey The KeyCode that can be used to open/close the console by default. Set to KeyCode.None to disable this behavior. The console can be manually opened/closed by calling DeveloperConsole.Open() and DeveloperConsole.Close() as well. KeyCode.BackQuote
Log Console Output ConsoleSettings.LogConsoleOutput Determines whether or not the output of the in-game developer console should be logged to the Unity debug console. For instance, if set to Always, the output of the developer console would always be logged to the Unity console; if set to Editor Only, this behavior would be enabled in the editor but not in the built executable, and so on. By enabling this feature, calls to DeveloperConsole.LogError will write errors to the Unity console (via Debug.LogError), calls to DeveloperConsole.LogWarning will write warnings (via Debug.LogWarning), and calls to DeveloperConsole.Log will write regular debug logs (via Debug.Log). Never
Redirect Unity Output ConsoleSettings.RedirectUnityConsoleOutput Determines whether or not the output of the Unity debug console should be logged to the in-game developer console. For instance, if set to Always, the output of the Unity console would always be logged to the in-game developer console; if set to Editor Only, this behaviour would be enabled in the editor but not in the built executable, and so on. By enabling this feature, Unity exceptions, assertions, and errors will be written to the developer console by calling DeveloperConsole.LogError, warnings via DeveloperConsole.LogWarning, and regular debug logs via DeveloperConsole.Log. Always
Select All On Open ConsoleSettings.SelectAllOnOpen Determines whether or not any input that has been written to the console (but not submitted) should be selected when the console is opened. For instance, if set to Always, this behavior would always be enabled; if set to Editor Only, this behavior would be enabled in the editor but not in the built executable, and so on. This setting is provided for convenience purposes, as it can make writing input to the console easier when one would otherwise have to re-select any old inputted text and delete it before entering a new command. Always
Max Entries ConsoleSettings.MaxEntries Determines the maximum number of entries that can be entered to the console at any given time. An entry to the console could be a line a text, an image, or a custom widget or blurb. Must be greater than or equal to one. If more than this many entries are created, the console will delete the oldest entries in the console until there are this many number of entries remaining. Lower this value if there are performance issues associated with having too many entries in the console at once. 200
Max Input History ConsoleSettings.MaxInputHistory Determines the maximum number of past user inputs that can be cached by the console at any given time. In similar fashion to a Linux or Windows console, the in-game developer console will store a log of past inputted commands that can be cycled through using the up and down arrow keys. If there are more than this many number of past inputs cached in memory, the console will delete the oldest inputs until there are this many cached inputs remaining. 50
Pause Game ConsoleSettings.PauseOnOpen Determines whether or not the game should be paused when the console is opened by setting Time.timeScale and Time.fixedDeltaTime to zero. For instance, if set to Always, the game would always be paused when the console is opened; if set to Editor Only, it would only be paused when running the game in the editor but not in the built executable, and so on. If this feature is enabled, Time.timeScale and Time.fixedDeltaTime will be restored to their original values when the console is closed. Always
Home Directory ConsoleSettings.HomeDirectoryMode Determines the path to the console's home directory. Set to: Persistent Data Path
Home Directory Path ConsoleSettings.CustomHomeDirectory If Home Directory is set to Custom, this setting will become visible in the console settings window. Specifies the custom console home directory. Clicking on the folder icon on the right side of this setting allows you to browse for a desired folder. Additionally, environment variables such as %HOMEPATH% will be expanded to their actual paths before this value is used by console. Application.persitentDataPath

Visual Settings

Settings that are purely visual and do not affect the functionality or behavior of the developer console.

Setting Name API Name Description Default Value
Font ConsoleSettings.ConsoleFont The TextMeshPro Font Asset that will be used by to render text to the console. Ideally, this should be a monospaced font, such as Courier. CourierPrime
Font Size ConsoleSettings.ConsoleFontSize The size of the font (in TextMeshPro point units) used to render text to the console. 15
Overlay Alpha ConsoleSettings.ConsoleOverlayAlpha Specifies the alpha (transparency) of the console overlay upon which all console content is rendered. Value must be betweeen 0 and 1, with 0 representing a completely transparent overlay and 1 representing an opaque black overlay. 0.3
Font Color ConsoleSettings.ConsoleFontColor The color that is used to render any non-error, non-warning text in the console. Note that this can be overriden by using rich-text tags such as <color/>. #ffffff
Warning Color ConsoleSettings.ConsoleFontWarningColor The color that is used to render warning text to the console. Note that this can be overriden by using rich-text tags such as <color/>. #deac49
Error Color ConsoleSettings.ConsoleFontWarningColor The color that is used to render error text to the console. Note that this can be overridden by using rich-text tags such as <color/>. #cc5254
Path Color ConsoleSettings.ConsoleFontWarningColor The color that is used to render the console's current working directory. #abcdad
Prefix Character ConsoleSettings.ConsolePrefixChar The character that is used to prefix console input. $