|
|
|
|
|
|
public MouseTracker( |
|
|
|
PointerRouter router, |
|
|
|
MouseDetectorAnnotationFinder annotationFinder, |
|
|
|
bool inEditor = false |
|
|
|
bool inEditorWindow = false |
|
|
|
this.inEditor = inEditor; |
|
|
|
this.inEditorWindow = inEditorWindow; |
|
|
|
readonly bool inEditor; |
|
|
|
readonly bool inEditorWindow; |
|
|
|
|
|
|
|
readonly Dictionary<int, PointerEvent> _lastMouseEvent = new Dictionary<int, PointerEvent>(); |
|
|
|
|
|
|
|
|
|
|
this._scheduleMousePositionCheck(); |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
if (this.inEditor) { |
|
|
|
this._scheduleDragFromEditorMousePositionCheck(); |
|
|
|
} |
|
|
|
this._scheduleDragFromEditorMousePositionCheck(); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
PointerExitEvent.fromHoverEvent((PointerHoverEvent) this._lastMouseEvent[deviceId])); |
|
|
|
} |
|
|
|
#if UNITY_EDITOR
|
|
|
|
if (this.inEditor && annotation.onDragFromEditorExit != null) { |
|
|
|
annotation.onDragFromEditorExit( |
|
|
|
PointerDragFromEditorExitEvent.fromDragFromEditorEvent(this._lastMouseEvent[deviceId])); |
|
|
|
this.detachDragFromEditorAnnotation(annotation, deviceId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this._trackedAnnotations.Remove(annotation); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
if (this.inEditor) { |
|
|
|
this._handleDragFromEditorEvent(evt, deviceId); |
|
|
|
} |
|
|
|
this._handleDragFromEditorEvent(evt, deviceId); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_TrackedAnnotation hitAnnotation = this._findAnnotation(hit); |
|
|
|
|
|
|
|
//enter
|
|
|
|
if (!hitAnnotation.activeDevices.Contains(deviceId)) { |
|
|
|
hitAnnotation.activeDevices.Add(deviceId); |
|
|
|