Say I have a gui slider controlling a model property and when the user mouse over this slider I want to hilite the 3d model that will be affected by this slider.
Problem is I can't find a way to register a function to gui mouse events. I do not need to modify the style or skin of the gui on mouseover, I need to call a function of mine.
Is it possible? or am I missing the plain obvious?
@Jean-Fabre 's answer is on point, that is, if your tool uses only one window instance.
Should it allow for more than one instance at a time, the detection breaks a bit.
The only solution I’ve found is to limit the detection to mouse event, and so I replaced Repaint with MouseMove
if (Event.current.type == EventType.MouseMove &&
GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
{
usingSlider=true;
}