24 lines
606 B
C#
24 lines
606 B
C#
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
|
|
public class ToolTipTrigger : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
|
{
|
|
private static LTDescr delay;
|
|
[SerializeField] private string _content;
|
|
[SerializeField] private string _header;
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
delay = LeanTween.delayedCall(0.5f, () =>
|
|
{
|
|
ToolTipSystem.Show(_content, _header);
|
|
});
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
LeanTween.cancel(delay.uniqueId);
|
|
ToolTipSystem.Hide();
|
|
}
|
|
}
|