|
|
|
|
|
|
PointerCancelEventListener onPointerCancel = null, |
|
|
|
PointerScrollEventListener onPointerScroll = null, |
|
|
|
HitTestBehavior behavior = HitTestBehavior.deferToChild, |
|
|
|
RenderBox child = null, |
|
|
|
|
|
|
|
RenderBox child = null |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter = null, |
|
|
|
PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover = null, |
|
|
|
PointerDragFromEditorExitEventListener onPointerDragFromEditorExit = null, |
|
|
|
PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null |
|
|
|
,PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter = null |
|
|
|
,PointerDragFromEditorHoverEventListener onPointerDragFromEditorHover = null |
|
|
|
,PointerDragFromEditorExitEventListener onPointerDragFromEditorExit = null |
|
|
|
,PointerDragFromEditorReleaseEventListener onPointerDragFromEditorRelease = null |
|
|
|
#endif
|
|
|
|
) : base(behavior: behavior, child: child) { |
|
|
|
this.onPointerDown = onPointerDown; |
|
|
|
this.onPointerMove = onPointerMove; |
|
|
|
|
|
|
this._onPointerEnter = onPointerEnter; |
|
|
|
this._onPointerHover = onPointerHover; |
|
|
|
this._onPointerExit = onPointerExit; |
|
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
#endif
|
|
|
|
this._onPointerExit != null || |
|
|
|
this._onPointerDragFromEditorEnter != null || |
|
|
|
this._onPointerDragFromEditorHover != null || |
|
|
|
this._onPointerDragFromEditorExit != null || |
|
|
|
this._onPointerDragFromEditorRelease != null) { |
|
|
|
this._onPointerExit != null |
|
|
|
#if UNITY_EDITOR
|
|
|
|
|| this._onPointerDragFromEditorEnter != null |
|
|
|
|| this._onPointerDragFromEditorHover != null |
|
|
|
|| this._onPointerDragFromEditorExit != null |
|
|
|
|| this._onPointerDragFromEditorRelease != null |
|
|
|
#endif
|
|
|
|
) { |
|
|
|
onExit: this._onPointerExit, |
|
|
|
onDragFromEditorEnter: this._onPointerDragFromEditorEnter, |
|
|
|
onDragFromEditorHover: this._onPointerDragFromEditorHover, |
|
|
|
onDragFromEditorExit: this._onPointerDragFromEditorExit, |
|
|
|
onDragFromEditorRelease: this._onPointerDragFromEditorRelease |
|
|
|
onExit: this._onPointerExit |
|
|
|
#if UNITY_EDITOR
|
|
|
|
,onDragFromEditorEnter: this._onPointerDragFromEditorEnter |
|
|
|
,onDragFromEditorHover: this._onPointerDragFromEditorHover |
|
|
|
,onDragFromEditorExit: this._onPointerDragFromEditorExit |
|
|
|
,onDragFromEditorRelease: this._onPointerDragFromEditorRelease |
|
|
|
#endif
|
|
|
|
|
|
|
|
public PointerDownEventListener onPointerDown; |
|
|
|
|
|
|
|
public PointerMoveEventListener onPointerMove; |
|
|
|
|
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
PointerDragFromEditorEnterEventListener _onPointerDragFromEditorEnter; |
|
|
|
|
|
|
|
public PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter { |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endif
|
|
|
|
|
|
|
|
public PointerEnterEventListener onPointerEnter { |
|
|
|
get { return this._onPointerEnter; } |
|
|
|
|
|
|
|
|
|
|
PointerExitEventListener _onPointerExit; |
|
|
|
|
|
|
|
public PointerDownEventListener onPointerDown; |
|
|
|
|
|
|
|
public PointerMoveEventListener onPointerMove; |
|
|
|
|
|
|
|
public PointerUpEventListener onPointerUp; |
|
|
|
|
|
|
|
public PointerCancelEventListener onPointerCancel; |
|
|
|
|
|
|
void _updateAnnotations() { |
|
|
|
D.assert(this._onPointerEnter != this._hoverAnnotation.onEnter || |
|
|
|
this._onPointerHover != this._hoverAnnotation.onHover || |
|
|
|
this._onPointerExit != this._hoverAnnotation.onExit || |
|
|
|
this._onPointerDragFromEditorEnter != this._hoverAnnotation.onDragFromEditorEnter || |
|
|
|
this._onPointerDragFromEditorHover != this._hoverAnnotation.onDragFromEditorHover || |
|
|
|
this._onPointerDragFromEditorExit != this._hoverAnnotation.onDragFromEditorExit || |
|
|
|
this._onPointerDragFromEditorRelease != this._hoverAnnotation.onDragFromEditorRelease, |
|
|
|
() => "Shouldn't call _updateAnnotations if nothing has changed."); |
|
|
|
this._onPointerExit != this._hoverAnnotation.onExit |
|
|
|
#if UNITY_EDITOR
|
|
|
|
|| this._onPointerDragFromEditorEnter != this._hoverAnnotation.onDragFromEditorEnter |
|
|
|
|| this._onPointerDragFromEditorHover != this._hoverAnnotation.onDragFromEditorHover |
|
|
|
|| this._onPointerDragFromEditorExit != this._hoverAnnotation.onDragFromEditorExit |
|
|
|
|| this._onPointerDragFromEditorRelease != this._hoverAnnotation.onDragFromEditorRelease |
|
|
|
#endif
|
|
|
|
, () => "Shouldn't call _updateAnnotations if nothing has changed."); |
|
|
|
|
|
|
|
if (this._hoverAnnotation != null && this.attached) { |
|
|
|
RendererBinding.instance.mouseTracker.detachAnnotation(this._hoverAnnotation); |
|
|
|
|
|
|
this._onPointerHover != null || |
|
|
|
this._onPointerExit != null || |
|
|
|
this._onPointerDragFromEditorEnter != null || |
|
|
|
this._onPointerDragFromEditorHover != null || |
|
|
|
this._onPointerDragFromEditorExit != null || |
|
|
|
this._onPointerDragFromEditorRelease != null) { |
|
|
|
this._onPointerExit != null |
|
|
|
#if UNITY_EDITOR
|
|
|
|
|| this._onPointerDragFromEditorEnter != null |
|
|
|
|| this._onPointerDragFromEditorHover != null |
|
|
|
|| this._onPointerDragFromEditorExit != null |
|
|
|
|| this._onPointerDragFromEditorRelease != null |
|
|
|
#endif
|
|
|
|
) { |
|
|
|
onExit: this._onPointerExit, |
|
|
|
onDragFromEditorEnter: this._onPointerDragFromEditorEnter, |
|
|
|
onDragFromEditorHover: this._onPointerDragFromEditorHover, |
|
|
|
onDragFromEditorExit: this._onPointerDragFromEditorExit, |
|
|
|
onDragFromEditorRelease: this._onPointerDragFromEditorRelease |
|
|
|
onExit: this._onPointerExit |
|
|
|
#if UNITY_EDITOR
|
|
|
|
, onDragFromEditorEnter: this._onPointerDragFromEditorEnter |
|
|
|
, onDragFromEditorHover: this._onPointerDragFromEditorHover |
|
|
|
, onDragFromEditorExit: this._onPointerDragFromEditorExit |
|
|
|
, onDragFromEditorRelease: this._onPointerDragFromEditorRelease |
|
|
|
#endif
|
|
|
|
); |
|
|
|
|
|
|
|
if (this.attached) { |
|
|
|