In-Game Console
Last updated
Last updated
This Component gives you an in-game console that provides Logs and Alerts from Unity, but at runtime within your game. This can be used for debugging on the actual device, without using a development build. A prefab is included in the module and can be dragged into your scene hierarchy.
The console is hidden at start and is toggled on and off using the selected key.
The Console Prefab has two scripts, In Game Console and Sys Info Extended. The SysInfo script should only be changed if you are creating your own or modifying the prefab. However, the in Game Console script allows you to use Admin Mode. This mode will allow you to:
Disable Commands
Disable Updates (those commands with parameters)
Disable Unity Error logs.
You can configure these when developing, or change them at runtime by Call Method from your own scripts.
The Console window itself is self explanatory. The SysInfo Button toggles the Realtime System Information, and the Clear button clears the log. The System Information provides Platform data and Realtime Performance data. This display also provides build data such as the Version of Unity used and the System Language. The Verified App Integrity display True if the App has not been tampered with, of False if it has. You can use this as an anti-piracy check because it checks if the application was altered after being built.
Entering a ? in the command line will display the current commands that are available, including any that you have created yourself using the provided Template.
Currently, this asset comes with 4 predefined display commands.
? - displays a list of defined commands including any ones you have added
build - displays the build information of the game, also shown in the SysInfo.
quality - display the current quality level that the game is set to.
quit - quits the game on the device or play mode in the editor.
This asset also has 5 predefined Update commands.
frames - resets the applications target frame rate. ie: frames 30 (sets to 30 fps) frames 300 (sets to as fast as the device will run).
vsync - resets the vsync count of the build. ie: vsync 0 (turns off vSync) vsync 2 (2 vSyncs should pass between each frame).
quality+ - increases the quality level of the game with or without expensive changes as defined by Unity. ie: quality+ true (increase the quality level by 1 and include expensive changes such as antiAliasing).
quality- - decreases the quality level of the game with or without expensive changes as defined by Unity. ie: quality- false (decrease the quality level by 1 and and dont include expensive changes such as antiAliasing).
time - changes the time scale of the game. ie: time 0.5 (time passes 2x slower than realtime) time 1 (resets time to realtime).
The In-Game Console comes with a Template Script for creating custom commands and this is detailed in a tutorial below.