Unity-Technologies / EditorXR

Author XR in XR
Other
928 stars 166 forks source link

Fix an issue where custom tool menus never hide #517

Closed mtschoen-unity closed 5 years ago

mtschoen-unity commented 5 years ago

Purpose of this PR

This was broken by an earlier fix (fda33e21) to show the ray when the menu is hidden by workspaces--moving the for loop which clears temporary visibility to the top of UpdateMenuVisibilities caused all earlier visibility changes (i.e. from DeviceInputModule) to be overridden.

Testing status

Tested by hovering over workspaces and UI with the Main Menu open on its own, with a custom tool menu (i.e. Annotation or CreatePrimitive) and with the Main Menu open "on top of" a custom tool menu

Technical risk

Medium -- this changes how menu hiding works, which may introduce bugs relating to menu hiding.

Comments to reviewers

The reason I switched from add/remove in UpdateRayForDevice to add/add is that I need to override the tool's setting to hide the ray--the tool is not aware that the menus are hiding, so we just need to leave its visibility setting in the list, and override it with a priority of 1.