|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using Unity.Profiling; |
|
|
|
using Unity.UIWidgets.engine; |
|
|
|
using Unity.UIWidgets.rendering; |
|
|
|
using UnityEngine.Profiling; |
|
|
|
|
|
|
|
namespace Unity.UIWidgets.gestures { |
|
|
|
public class GestureBinding : BindingBase, HitTestable, HitTestDispatcher, HitTestTarget { |
|
|
|
|
|
|
dispatchEvent(evt, hitTestResult); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void _handlePointerScrollEvent(PointerEvent evt) { |
|
|
|
pointerRouter.clearScrollRoute(evt.pointer); |
|
|
|
if (!pointerRouter.acceptScroll()) { |
|
|
|
|
|
|
|
|
|
|
foreach (HitTestEntry entry in hitTestResult.path) { |
|
|
|
try { |
|
|
|
entry.target.handleEvent(evt.transformed(entry.transform), entry); |
|
|
|
entry.target.handleEvent(()=> evt.transformed(entry.transform), entry); |
|
|
|
} |
|
|
|
catch (Exception ex) { |
|
|
|
D.logError("Error while dispatching a pointer event: ", ex); |
|
|
|
|
|
|
static readonly ProfilerMarker s_sPreparePerfMarker = new ProfilerMarker("MySystem.XXXX"); |
|
|
|
public void handleEvent(PointerEvent evt, HitTestEntry entry) { |
|
|
|
public void handleEvent(Func<PointerEvent> evts, HitTestEntry entry) { |
|
|
|
var evt = evts(); |
|
|
|
pointerRouter.route(evt); |
|
|
|
if (evt is PointerDownEvent) { |
|
|
|
gestureArena.close(evt.pointer); |
|
|
|