1
This commit is contained in:
@@ -9,6 +9,9 @@ namespace BITKit.UX
|
||||
{
|
||||
public class UXToolTips : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
[ReadOnly]
|
||||
private string currentHoverName;
|
||||
private VisualElement root;
|
||||
private Label label;
|
||||
|
||||
@@ -51,10 +54,12 @@ namespace BITKit.UX
|
||||
|
||||
if (!EventSystem.current.IsPointerOverGameObject()) return "";
|
||||
|
||||
var screenPosition = Input.mousePosition;
|
||||
var screenPosition = Mouse.current.position.ReadValue();
|
||||
screenPosition.y = Screen.height - screenPosition.y;
|
||||
|
||||
VisualElement ve = panel.Pick(RuntimePanelUtils.ScreenToPanel(panel, screenPosition));
|
||||
|
||||
currentHoverName = ve?.name;
|
||||
return ve == null ? "" : ve.tooltip;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user