From a4aa8e5709ba040cebbcab46df5bcc5138ff933d Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Aug 2020 19:05:55 -0700 Subject: [PATCH] Fix an issue where Spatial Menu could interrupt manipulator and other UI drag operations --- .../MultipleRayInputModule/MultipleRayInputModule.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/Input/MultipleRayInputModule/MultipleRayInputModule.cs b/Runtime/Scripts/Input/MultipleRayInputModule/MultipleRayInputModule.cs index 559163f9a..dff8a1985 100644 --- a/Runtime/Scripts/Input/MultipleRayInputModule/MultipleRayInputModule.cs +++ b/Runtime/Scripts/Input/MultipleRayInputModule/MultipleRayInputModule.cs @@ -113,14 +113,20 @@ public void ProcessInput(ActionMapInput input, ConsumeControlDelegate consumeCon m_Owner.ProcessMove(eventData); m_Owner.ProcessDrag(eventData, true); + var verticalScroll = uiActions.verticalScroll; + var horizontalScroll = uiActions.horizontalScroll; + if (eventData.dragging) + { + consumeControl(verticalScroll); + consumeControl(horizontalScroll); + } + // Send scroll events if (currentObject) { var hasScrollHandler = ExecuteEvents.GetEventHandler(currentObject); if (hasScrollHandler) { - var verticalScroll = uiActions.verticalScroll; - var horizontalScroll = uiActions.horizontalScroll; var verticalScrollValue = verticalScroll.value; var horizontalScrollValue = horizontalScroll.value; if (!Mathf.Approximately(verticalScrollValue, 0f) || !Mathf.Approximately(horizontalScrollValue, 0f))