add modal window UI
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user