| | 1 | | using UnityEngine; |
| | 2 | | using UnityEngine.EventSystems; |
| | 3 | |
|
| | 4 | | public class PointerOverDetector : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler |
| | 5 | | { |
| | 6 | | public delegate void Enter(PointerEventData eventData); |
| | 7 | | public delegate void Exit(PointerEventData eventData); |
| | 8 | |
|
| | 9 | | public event Enter OnEnter; |
| | 10 | | public event Exit OnExit; |
| | 11 | |
|
| 0 | 12 | | public void OnPointerEnter(PointerEventData eventData) { OnEnter?.Invoke(eventData); } |
| | 13 | |
|
| 0 | 14 | | public void OnPointerExit(PointerEventData eventData) { OnExit?.Invoke(eventData); } |
| | 15 | | } |