ugui双击长按

using UnityEngine;
using UnityEngine.EventSystems;


public class HitSecondTime : MonoBehaviour, IPointerClickHandler, IPointerDownHandler
{
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.clickCount == 2)
        {
            print("2 hit");
        }
    }
    public void OnPointerDown(PointerEventData eventData)
    {
        Invoke("OnLongPress", 1);
    }
    private void OnLongPress()
    {
        Debug.Log("LongPress");

    }

}

没有更多推荐了,返回首页