UnityMol  0.9.6-875
UnityMol viewer / In developement
BoundTooltipTrigger.cs
Go to the documentation of this file.
1 
4 
6 
7 using UnityEngine.EventSystems;
8 
9 namespace UnityEngine.UI.Extensions
10 {
11  [AddComponentMenu("UI/Extensions/Bound Tooltip/Tooltip Trigger")]
12  public class BoundTooltipTrigger : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, ISelectHandler, IDeselectHandler
13  {
14  public string text;
15 
16  public void OnPointerEnter(PointerEventData eventData)
17  {
18  StartHover(new Vector3(eventData.position.x, eventData.position.y, 0f));
19  }
20  public void OnSelect(BaseEventData eventData)
21  {
22  StartHover(transform.position);
23  }
24  public void OnPointerExit(PointerEventData eventData)
25  {
26  StopHover();
27  }
28  public void OnDeselect(BaseEventData eventData)
29  {
30  StopHover();
31  }
32 
33  void StartHover(Vector3 position)
34  {
36  }
37  void StopHover()
38  {
40  }
41  }
42 }
void OnPointerExit(PointerEventData eventData)
void OnPointerEnter(PointerEventData eventData)
Definition: GUIDisplay.cs:66