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

19 lines
454 B
C#
Raw Normal View History

2021-03-25 13:19:44 +01:00
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();
}