using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;

namespace WS
{
    ///<summary>指针事件</summary>
    public class PointerEventMono : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IPointerEnterHandler, IPointerExitHandler
    {
        ///<summary>按下</summary>
        public UnityAction OnDown;
        ///<summary>抬起</summary>
        public UnityAction OnUp;
        ///<summary>进入</summary>
        public UnityAction OnEnter;
        ///<summary>退出</summary>
        public UnityAction OnExit;

        public void OnPointerDown(PointerEventData eventData)
        {
            OnDown?.Invoke();
        }
        public void OnPointerUp(PointerEventData eventData)
        {
            OnUp?.Invoke();
        }
        public void OnPointerEnter(PointerEventData eventData)
        {
            OnEnter?.Invoke();
        }
        public void OnPointerExit(PointerEventData eventData)
        {
            OnExit?.Invoke();
        }
    }
}