I’m trying to “select” on mouseOver a Handle.Button
, but I cant find a solution that works.
I thought I can get the ID of the control, and then check if its the same ID than HandleUtility.nearestControl
, but this works with a few Handles, and others doesn’t.
Can anyone tell me what’s wrong? Or maybe another approach?
idNext = GUIUtility.GetControlID(FocusType.Passive) + 1;
if (Handles.Button(point, handleRotation, handleSize,pickSize, Handles.CircleHandleCap))
{
selectedIndex = index;
}
if (selectedIndex == index)
{
point = Handles.DoPositionHandle(point, handleRotation);
//some irrelevant code
}
else if (HandleUtility.nearestControl == idNext)
{
selectedIndex = index;
}