I am using IBeginDragHandler (and IDragHandler etc.) on a MonoBehaviour that is attached to that GameObject.
Right now i do…
bool _dragEnabled;
public void OnBeginDrag(PointerEventData eventData)
{
if (_dragEnabled)
{
//do something
}
else
{
eventData.pointerDrag = null;
}
}
…but find it rather hackish. I’d like to disable all drag events, so that OnBeginDrag (and OnDrag etc.) does not get called.