MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Add option to disable masking from RectTransformColliderFitter

Open camnewnham opened this issue 3 years ago • 3 comments

Overview

This PR adds an option to disable the masking behaviour of RectTransformColliderFitter. This is useful when a component needs to extend beyond a masked region (i.e. pop out of a ScrollRect.)

Changes

  • Fixes this issue where components that pop out of a ScrollRect have their colliders disabled. dropdown

:)

camnewnham avatar Sep 29 '22 03:09 camnewnham

Your popup menu looks fantastic, by the way! Feel free to open a PR for that too if you'd like!

I'm working on my own dropdown in another branch, but I'd love to take a look at yours as well.

Zee2 avatar Sep 29 '22 18:09 Zee2

I'm working on my own dropdown in another branch, but I'd love to take a look at yours as well.

I'd be happy to - though there are a couple of things to resolve before it'd be flexible enough and suitable for general consumption:

  1. https://github.com/microsoft/MixedRealityToolkit-Unity/pull/10795
  2. It's very easy to accidentally press through a popup and trigger the button or another piece of UI behind - can you suggest a strategy to work around this?
  3. It needs the equivalent of a "clickaway" listener - any suggestions?

camnewnham avatar Sep 29 '22 20:09 camnewnham

@camnewnham

It's very easy to accidentally press through a popup and trigger the button or another piece of UI behind - can you suggest a strategy to work around this? It needs the equivalent of a "clickaway" listener - any suggestions?

XRI doesn't really do "modality"; i.e., there's no way to push or pop layers of UI modally, so neither of these are really that easy to do with XRI. For the first one, I would suggest literally bringing the popup towards the user and increase the Z separation between the foreground popup and background.

Clickaway events are similarly tricky... clicking "away" implies that the thing itself has some sort of modal focus. In the future, we may ask XRI folks to either implement this sort of modality, or perhaps implement our own support for it as a subclass of the XRInteractionManager (or at least add "clickaway" event handling to the XRInteractionManager).

https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.html

Zee2 avatar Sep 29 '22 21:09 Zee2

/azp run

Zee2 avatar Oct 21 '22 21:10 Zee2

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 21 '22 21:10 azure-pipelines[bot]

/azp run

Zee2 avatar Oct 21 '22 21:10 Zee2

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Oct 21 '22 21:10 azure-pipelines[bot]

I've updated this to add some clarity. The previous approach using a setter was slightly confusing because runtime changes in editor (toggling useMask) wouldn't be triggered, which made the logic harder to read.

Instead:

  • Use the serialized editor-friendly property useMask to determine the intent (should mask be applied or not)
  • Cache value maskApplied to know the current state of the mask (is the mask currently applied)
  • During a Fit() operation, ensure that the mask is applied or removed as required

camnewnham avatar Oct 22 '22 03:10 camnewnham

/azp run

keveleigh avatar Nov 10 '22 18:11 keveleigh

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 10 '22 18:11 azure-pipelines[bot]