Esempio n. 1
0
 /// <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();
     }
 }
Esempio n. 2
0
 void IPointerUpHandler.OnPointerUp(PointerEventData eventData)
 {
     start   = Vector2.zero;
     current = Vector2.zero;
     delta   = Vector2.zero;
     holding = false;
     if (OnEndDrag != null)
     {
         OnEndDrag.Invoke();
     }
 }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
        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();
 }
Esempio n. 6
0
 private void StopDragging()
 {
     SetPhysicsActive(true);
     OnEndDrag?.Invoke(this);
 }