using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; /// /// Shows the hover overlay child of an icon button while the pointer is over /// the button or while the button is not interactable (marks the active mode). /// public class IconButtonHover : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { [SerializeField, Tooltip("Overlay object toggled on hover / while the button is disabled.")] private GameObject hover; [SerializeField, Tooltip("Button whose interactable state drives the disabled case. Defaults to the Button on this object.")] private Button button; private bool _pointerInside; private void Awake() { if (!button) button = GetComponent