Unity-Technologies / EditorXR

Author XR in XR
Other
929 stars 167 forks source link

Fix ray-based priority selection of SpatialMenu elements #524

Closed dunity closed 5 years ago

dunity commented 5 years ago

Purpose of this PR

Fix ray-based priority selection of SpatialMenu elements. Previously other SpatialMenu input modes would override the selection of ray-based hovered buttons.

Testing status

Tested in various SpatialMenu scenarios that would trigger the issue, and many "standard" SpatialMenu combinations of actions. I saw none of the previous issues, and no new issues present themselves.

Technical risk

Low -- These changes were kept isolated to the DisplayHighlightedSubMenuContents function in the SpatialMenuUI. In addition, there was a minor change made as to how highlighting is handled when selecting elements in the SpatialMenuSectionTitleElement controller. That change is automatically cleaned up when changing menu levels, will will occur during the selection of a TitleMenuElement; so shouldn't affect anything else.

Comments to reviewers

To repro the issue, (use a different branch), the use the thumbstick/trackpad to highlight a button in the Spatial Menu AFTER you have highlighted a button via a ray. When you use the trigger to select the button currently highlighted by the ray, you will select the button that was highlighted afterward via the thumbstick. This is the issue that has been remedied.