I'm trying to access my scrollrect, to know whether or not the component's drag is used, but the on-drag method is a function as the documentation says, some idea of how to access ondrag like:
"if ondrag is active ....."
I'm trying to access my scrollrect, to know whether or not the component's drag is used, but the on-drag method is a function as the documentation says, some idea of how to access ondrag like:
"if ondrag is active ....."
See ScrollRect.OnBeginDrag and ScrollRect.OnEndDrag
You can simply use the interfaces IBeginDragHandler
and IEndDragHandler
on your own component and e.g. set a bool there
public class YourComponent : MonoBehaviour, IBeginDragHandler, IEndDragHandler
{
public bool isDrag { get; private set; }
public void OnBeginDrag()
{
isDrag = true;
}
public void OnEndDrag()
{
isDrag = false;
}
}
and than check this bool instead
if(GetComponent<YourComponent>.isDrag) // ....