| | 1 | | using UnityEngine; |
| | 2 | | using UnityEngine.EventSystems; |
| | 3 | | using System; |
| | 4 | |
|
| | 5 | | public class UIHoverCallback : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler |
| | 6 | | { |
| | 7 | | public event Action OnPointerDown; |
| | 8 | | public event Action OnPointerEnter; |
| | 9 | | public event Action OnPointerExit; |
| | 10 | |
|
| 0 | 11 | | void IPointerDownHandler.OnPointerDown(PointerEventData eventData) { OnPointerDown?.Invoke(); } |
| | 12 | |
|
| 0 | 13 | | void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData) { OnPointerEnter?.Invoke(); } |
| | 14 | |
|
| 0 | 15 | | void IPointerExitHandler.OnPointerExit(PointerEventData eventData) { OnPointerExit?.Invoke(); } |
| | 16 | | } |