using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using UnityEngine.Events; public class UIImageAdvancedInteractions : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { [System.Serializable] public class UIEvent : UnityEvent { } [Header("Events")] public UIEvent onPointerEnter; public UIEvent onPointerExit; public UIEvent onPointerClick; private Image _image; private void Awake() { _image = GetComponent(); } public void OnPointerEnter(PointerEventData eventData) { onPointerEnter.Invoke(eventData); Debug.Log("OnPointerEnter"); } public void OnPointerExit(PointerEventData eventData) { onPointerExit.Invoke(eventData); Debug.Log("OnPointerExit"); } public void OnPointerClick(PointerEventData eventData) { onPointerClick.Invoke(eventData); Debug.Log("OnPointerClick"); } }