Пример #1
0
 public void InvokePointerDrag(Vector2 pointerPosition, Vector2 delta)
 {
     if (PointerDrag != null)
     {
         PointerDrag.Invoke(this, new PointerDraggedGraphicalElementEventArgs(pointerPosition, delta));
     }
 }
Пример #2
0
    public void OnDrag(PointerEventData eventData)
    {
        if (!pointerDown)
        {
            return;
        }

        if (eventData.pointerCurrentRaycast.gameObject == null ||
            eventData.pointerCurrentRaycast.gameObject.tag != "Brick")
        {
            return;
        }

        int index = eventData.pointerCurrentRaycast.gameObject.transform.GetSiblingIndex();

        PointerDrag?.Invoke(index);
    }