A useful tool for running specific code
What it is?
Unity | Compatible |
---|---|
2021 | ✅ |
2020 | ✅ |
2019 | ✅ |
- Add this tool to your project [how]
- Manage debug mode by following this path
Tools -> Debug Mode Definition ->
On
/Off
- For code that should be executed only when the debug mode is turned on, put it in the definition like this:
// ... code somewhere
#if DEBUG_MODE_IN_USE
// code here will be executed if the debug mode is turned on
#endif
// ... code somewhere
The package is available on the openupm registry. It's recommended to install it via openupm-cli.
openupm add com.inc8877.unity-debug-mode-define-symbol
Open Packages/manifest.json
with your favorite text editor. Add the following line to the dependencies block.
{
"dependencies": {
"com.inc8877.unity-debug-mode-define-symbol": "https://github.com/inc8877/UnityDebugModeDefineSymbol.git",
}
}
Cover background by Florian Olivo