weixin_39590739
weixin_39590739
2021-01-10 12:47

Added support for multiple constraint managers

Overview

This change allows to attach multiple constraint managers to one game object. Components supporting constraint manager (currently bounds control and object manipulator) can now choose which constraint manager they want to use in case there are more than one attached as well as the option to disable the functionality entirely. The default behavior for those components is to have constraint manager support enabled per default and they will link the default constraint manager (with auto mode) automatically.

The inspector of both bounds control and object manipulator will now refer to the constraint manager instead of showing the constraint list. Available constraint managers on the object will be exposed in a dropdown where the user can choose the one they want to use. There's also an option to scroll to and highlight the selected constraint manager to make it easier to find it (can be tricky as they all have the same name). To further distinguish between them there's a hint about which mode the attached constraint managers are currently in (auto or manual)

image

Constraint manager inspector

Constraint manager has now two modes for the user to switch between.

AutoSelection One of them is the automatic mode which will list all available constraint components that are attached to the gameobject as well as go to buttons and an option to add new components to the game object (this is pretty much the same ui we used to have integrated into the components).

ManualSelection

The second mode the user can pick is the manual mode where they can select constraints to process themselves. For this there's two options available - one of them adds (and lists) existing components via dropdown

image

The other one (like auto mode) will offer to attach a new component and add it to the manual list.

image

Components in the manual list can be removed from the list via remove entry buttons or highlighted with the goto button.

This change also includes conceptual documentation for constraint manager as well as an update to object manipulator docs. To avoid broken links there's also a dummy doc for bounds control that will be filled in the next week in a separate PR.

Two playmode tests for verifying the manual constraint list filter as well as using two constraint managers on the same component were added to the constraint tests.

Finally all scenes where bounds control was picking up the wrong rotation constraint from object manpulator were patched and bounds control is now using it's own filtered constraint manager.

Changes

  • Fixes: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/8555

Verification

  • added tests to verify manual constraint list in constraint manager and having two constraint managers with different setup attached to the same game object

  • Please have a look at the changed scenes, if bounds control behavior is as expected, especially hand interaction scene. (see linked issue https://github.com/microsoft/MixedRealityToolkit-Unity/issues/8555 )

  • Try to play around with the added inspectors for constraint manager and the integrations into bounds control / object manipulator

该提问来源于开源项目:microsoft/MixedRealityToolkit-Unity

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

15条回答

为你推荐