Fix for issue #30: Canvas interaction without VRCUIShape#46
Merged
calle242 merged 1 commit intoreleases/1.2.2from Aug 19, 2022
Merged
Fix for issue #30: Canvas interaction without VRCUIShape#46calle242 merged 1 commit intoreleases/1.2.2from
calle242 merged 1 commit intoreleases/1.2.2from
Conversation
…at has no VRCUIShape script on Start
momo-the-monster
approved these changes
Aug 17, 2022
Collaborator
There was a problem hiding this comment.
Looks good to me, fixes the issue as far as I can tell, and works fine without any canvases in the scene. My only request is that you point this PR to merge into releases/1.2.2 instead of main. I've already added a changelog there and included a note on this fix.
MrQ89
approved these changes
Aug 18, 2022
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes an issue where UI is not interactable when moved into Canvas that has no VRCUIShape script on Start.
In the test package provided here, a Canvas gets childed to another canvas which has no child VRC_UiShape.
Raycasts then fail to work because the new parent has no Event Camera (which VRC_UiShapes add to their parents).
The new child does have a VRC_UiShape but it doesn't add an Event Camera due to already having been initialized.
This fix iterates all scene Canvases in Start, and sets the _playerCamera if their event camera is null, which is a broken state anyway. Question: do we know of any other systems relying on cameras, that this might mess with?