
示例代码:
using UnityEngine.EventSystems;
public class TestOnDrag : MonoBehaviour, IDragHandler, IBeginDragHandler, IEndDragHandler
{
public void OnBeginDrag(PointerEventData eventData)
{
throw new System.NotImplementedException();
}
public void OnDrag(PointerEventData eventData)
{
throw new System.NotImplementedException();
}
public void OnEndDrag(PointerEventData eventData)
{
throw new System.NotImplementedException();
}
}
RectTransformUtility.ScreenPointToLocalPointInRectangle(
cachedRectTransform, eventData.position, cam, out thumbPosition);