A
A
Azmi2021-12-10 16:07:34
Unity
Azmi, 2021-12-10 16:07:34

How to make the right mouse button work in IDragHandler, IEndDragHandler, etc.?

I connected means IBeginDragHandler, IDragHandler, IEndDragHandler and implemented the interface of each of them in this way

public void OnBeginDrag(PointerEventData eventData)
  {
    Debug.Log(eventData.hovered.Count);
  }

public void OnDrag(PointerEventData eventData)
    {
    Debug.Log(eventData.hovered.Count);
  }

    public void OnEndDrag(PointerEventData eventData)
    {
    Debug.Log(eventData.hovered.Count);
  }


When I hold down the left mouse button and start moving it, debug displays numbers, 0 is displayed only if I went beyond the object, but when I hold down the right mouse button and do the same, 0 is displayed constantly, there is a possibility make the right mouse button work the same as the left

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mustGamedev, 2021-12-11
@mustGamedev

IPointerUp, IPointerDown

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question