revival/game/Assets/Scripts/UI/HoverSelect.cs

19 lines
454 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class HoverSelect : MonoBehaviour, IPointerEnterHandler
{
private Selectable _selectable;
private void OnEnable()
{
_selectable = GetComponent<Selectable>();
}
public void OnPointerEnter( PointerEventData eventData )
=> _selectable.Select();
}