It's difficult to retrieve logs and warnings from Unity outside the editor. To
make it easier, this console displays output from Debug
in the game itself.
This is especially useful on mobile devices.
for version 1.4.2
"com.matthewminer.consolation":"https://github.com/wolf-package/consolation.git#1.4.2",
Attach the ConsoleInGame
component to a game object. When playing your game, open
the console window with the back quote key `. This shortcut is
configurable in the inspector.
Alternatively, enable shake-to-open in the inspector to open the console on mobile devices. The component provides an option to prevent accidental shakes by requiring 3 or more fingers on the screen.
Several other settings like font size and the maximum log count are also configurable in the inspector.
- Toggle on/off console window
ConsoleInGame.Activate(true);
- Enable custom size window
ConsoleInGame.IsCustomSizeWindowConsole = true;
// Or
ConsoleInGame.IsCustomSizeWindowConsole = false;
- Set custom width (only work when
EnableCustomSizeWindow = true
)
ConsoleInGame.CustomWidth = 650;
- Set custom height (only work when
EnableCustomSizeWindow = true
)
ConsoleInGame.CustomHeight = 700;
- Set log font size
ConsoleInGame.LogFontSize = 20;
- Set scale factor
ConsoleInGame.ScaleFactor = 1.5f;
Supports Unity 2017.x and above. It hasn't been tested on all the platforms that Unity supports but it probably works on most.