Implemented rudimental multi-display support#265
Open
Propel-antonin wants to merge 5 commits intomob-sakai:developfrom
Open
Implemented rudimental multi-display support#265Propel-antonin wants to merge 5 commits intomob-sakai:developfrom
Propel-antonin wants to merge 5 commits intomob-sakai:developfrom
Conversation
Author
|
This was not tested in VR yet. I do not know if Display returns the correct values using the Display API. We might need to use this in VR mode? |
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.
Description
1. I'm not using Screen.width/Screen.height anymore, instead, all GetScreenSize() methods require a displayIndex.
In build, I use something like this:
In editor, it's a little trickier, I have to cache the active editor window's resolution. If the cache for a certain displayIndex is missing, I use reflection to find the gameview windows and grab their resolution directly. This only happens once after recompiling, so it shouldn't affect performance too much.
2. This display index is obtained by first finding the canvas of a graphic, and either grabbing its
displayIndex(if it's an overlay canvas) or its worldCamera'sdisplayIndex.Fixes #264
Type of change
Please write the commit message in the format corresponding to the change type.
Please see Conventional Commits for more information.
Test environment
https://docs.unity3d.com/2022.2/Documentation/Manual/MultiDisplay.html
It seems like everything should still work fine on Mobile.
Checklist
developbranch