Ejemplo n.º 1
0
    public void OnDrag(PointerEventData eventData)
    {
        float distance = Vector3.SqrMagnitude(eventData.position - eventData.pressPosition);

        if (distance >= distanceMagnitude && !directionChanged)
        {
            Vector3   dirVector     = (eventData.position - eventData.pressPosition).normalized;
            Direction dragDirection = DirectionHelper.GetDragDirection(dirVector);
            OnDragEndEvent?.Invoke(dragDirection);
            directionChanged = true;
        }
    }