TextureCombiner/Assets/Scripts/UI/HoverInfo.cs

21 lines
484 B
C#
Raw Permalink Normal View History

2020-11-01 03:54:32 +01:00
using UnityEngine;
using UnityEngine.EventSystems;
namespace TextureCombiner
{
public class HoverInfo : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
[SerializeField, Multiline]
private string m_text = "";
public void OnPointerEnter(PointerEventData eventData)
{
HoverInfoBox.s_hoverInfoBox.Show(m_text, eventData.position);
}
public void OnPointerExit(PointerEventData eventData)
{
HoverInfoBox.s_hoverInfoBox.Hide();
}
}
}