WXMC/.svn/pristine/03/03609d889ea6e32fa54d528254d43bef05809640.svn-base

32 lines
911 B
Plaintext
Raw Normal View History

2024-12-04 16:18:46 +08:00
using UnityEngine;
using UnityEngine.EventSystems;
public class DragImage : MonoBehaviour,IDragHandler,IBeginDragHandler,IEndDragHandler
{
public bool isDrag;
public void OnBeginDrag(PointerEventData eventData)
{
GameObject draggedObject = eventData.pointerDrag;
if (draggedObject != null && draggedObject.name == gameObject.name)
{
isDrag = true;
}
}
public void OnDrag(PointerEventData eventData)
{
GameObject draggedObject = eventData.pointerDrag;
if (draggedObject != null && draggedObject.name == gameObject.name)
{
isDrag = true;
}
}
public void OnEndDrag(PointerEventData eventData)
{
GameObject draggedObject = eventData.pointerDrag;
if (draggedObject != null && draggedObject.name == gameObject.name)
{
isDrag = false;
}
}
}