public virtual void OnUIPointerElementDragEnd(VRTK4UIPointerEventArgs e) { if (UIPointerElementDragEnd != null) { UIPointerElementDragEnd(this, e); } }
public virtual void OnUIPointerElementEnter(VRTK4UIPointerEventArgs e) { if (e.currentTarget != currentTarget) { ResetHoverTimer(); } if (clickAfterHoverDuration > 0f && hoverDurationTimer <= 0f) { canClickOnHover = true; hoverDurationTimer = clickAfterHoverDuration; } currentTarget = e.currentTarget; IsValidStateForClickFromHover = true; if (pointerEventData.pointerPress != null && pointerEventData.pointerPress != currentTarget) { IsValidStateForClickFromHover = false; } if (UIPointerElementEnter != null) { UIPointerElementEnter(this, e); } }
public virtual void OnUIPointerElementClick(VRTK4UIPointerEventArgs e) { if (e.currentTarget == currentTarget) { ResetHoverTimer(); } if (IsValidStateForClickFromHover && !ExplicitBlockClickOnce) { if (UIPointerElementClick != null) { UIPointerElementClick(this, e); } } }
public virtual void OnUIPointerElementExit(VRTK4UIPointerEventArgs e) { if (e.previousTarget == currentTarget) { ResetHoverTimer(); } ExplicitBlockClickOnce = false; IsValidStateForClickFromHover = false; if (UIPointerElementExit != null) { UIPointerElementExit(this, e); if (attemptClickOnDeactivate && !e.isActive && e.previousTarget) { if (pointerEventData == null) { pointerEventData = new PointerEventData(EventSystem.current); } pointerEventData.pointerPress = e.previousTarget; } } }