Fix not respecting Device Simulator safearea in Standalone Editor mode#73
Open
DDRKirbyISQ wants to merge 2 commits into5argon:masterfrom
Open
Fix not respecting Device Simulator safearea in Standalone Editor mode#73DDRKirbyISQ wants to merge 2 commits into5argon:masterfrom
DDRKirbyISQ wants to merge 2 commits into5argon:masterfrom
Conversation
In 5argon#60 the ToScreenRelativeRect logic was changed for standalone builds. However, using the device simulator in the Unity Editor (NotchSolutionUtilityEditor.UnityDeviceSimulatorActive) is still possible even when UNITY_STANDALONE is true, i.e. if you want to check some device simulation without changing your active editor platform. This adds a guard so that Screen.currentResolution is still used in this case.
Author
|
I guess it's worth noting that some other platforms may need some additional support/fixes, as noted in #50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #60 the ToScreenRelativeRect logic was changed for standalone builds.
However, using the device simulator in the Unity Editor (NotchSolutionUtilityEditor.UnityDeviceSimulatorActive) is still possible even when UNITY_STANDALONE is true, i.e. if you want to check some device simulation without changing your active editor platform.
This adds a guard so that Screen.currentResolution is still used in this case.
The logic is a little clunky because of the preprocessor logic and because we need to account for NotchSolutionUtilityEditor being editor-only; ideally you'd probably create a property that abstracts this logic but I wanted to patch this with as small of a change as possible