/// <summary> /// Handler for controller trigger up /// </summary> /// <param name="controllerId">Controller ID</param> /// <param name="triggerValue">Trigger Value (unused)</param> private void HandleTriggerUp(byte controllerId, float triggerValue) { if (_controllerConnectionHandler.IsControllerValid(controllerId)) { _isDragging = false; OnEndDrag?.Invoke(); } }
void IPointerUpHandler.OnPointerUp(PointerEventData eventData) { start = Vector2.zero; current = Vector2.zero; delta = Vector2.zero; holding = false; if (OnEndDrag != null) { OnEndDrag.Invoke(); } }
private void EndDrag() { lineRenderer.enabled = false; lineRenderer.positionCount = 0; dragging = false; rb.velocity = Vector2.zero; rb.gravityScale = normalGravity; rb.AddForce(-direction, ForceMode2D.Impulse); AudioManager.Play(impulseSound); endDrag = false; OnEndDrag?.Invoke(); }
public static Result <bool> EndDrag(PointerEventData eventData) { if (currentDragModel == null) { throw new ArgumentException("Can not end drag, BeginDrag() was never called."); } var result = handler.EndDrag(currentDragModel, eventData); OnEndDrag?.Invoke(currentDragModel, eventData); Clean(); return(result); }
/// <summary> /// Stop the current drag / drop operation no matter what state it is in. /// </summary> public void EndDrag() { Dragged = default; _state = DragState.NotDragging; _onEndDrag.Invoke(); }
private void StopDragging() { SetPhysicsActive(true); OnEndDrag?.Invoke(this); }