-
Notifications
You must be signed in to change notification settings - Fork 77
Add Allow Debug option to Build Configuration UI #1413
Conversation
Could you include a screenshot of what this looks like? |
@@ -801,37 +758,11 @@ private BuildOptions ConfigureAndroid(BuildTargetConfig buildTarget) | |||
options &= ~BuildOptions.Development; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently you can get into a state where development is off and debug is on:
- Enabled Development
- Enable Debug
- Disable Development
The UI will show them both disabled, but the build options will still have the debug flag set.
Should this line also turn off the debug flag for consistency between the UI & the backing data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's a good idea to explicitly disabled the flag when the development
toggle is disabled.
Something interesting that I didn't realise happened in the UI code:
Starting at the third step in your comment
- Development flag is disabled
- The UI and flags are now in an inconsistent state since the UI shows the
Allow Debug
option as disabled whereas the flag internally is enabled - On the next render of the UI, in the
ConfigureDebug
function theisDebugEnabled
variable is nowfalse
. This means the if statement inside theusing
block will always trigger theelse
case causing theAllowDebugging
flag to be disabled.
Even though I don't explicitly disable the flag, due to the way EditorGUILayout.Toggle()
works in the EditorGUI.DisabledScope
it will always return false when the development flag is disabled causing an update to the AllowDebugging
flag and disabling the flag anyway.
Co-authored-by: Paul Balaji <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
For UTY-2015
Description
Added
Allow Debug
option to build config that is only accessible whenDevelopment
is enabledSmall refactor of the code that creates the UI for each platform
Tests
How did you test these changes prior to submitting this pull request?
Manually tested that debugging works in both Rider and Visual Studio, thanks @jamiebrynes7!
Documentation
How is this documented (for example: release note, upgrade guide, feature page, in-code documentation)?
Docs: https://documentation.improbable.io/gdk-for-unity/v0.3.8/docs/debugging-in-the-player