using System; using System.Collections; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using ZGame; namespace HK.FUJIFILM { public class DesignItemButton : MonoBehaviour, IPointerDownHandler, IDragHandler, IPointerUpHandler { private Vector2 startPosition; private bool isDragging; private float dragThreshold = 1f; // 拖动阈值,可根据需要调整 public void OnPointerDown(PointerEventData eventData) { startPosition = eventData.position; isDragging = false; } public void OnDrag(PointerEventData eventData) { if (eventData.position != startPosition) { isDragging = true; } } public void OnPointerUp(PointerEventData eventData) { if (!isDragging) { EventManager.Instance.FireNow(this, new PhotoItemOperationEventArgs(true, transform)); Debug.Log("Button Clicked"); } } } }