- Home /
There is a way to check if a handle is highlighted?
Hi... i am developing a tile painter extension, and i decided to use Handles.Button to get the input i needed... now i need to be able to detect when a handle is highlighted ( mouse over handle ) so i can continue to add features... the event exists, the color of the handle even change when the mouse is over it... but i can not find a way to access that event... any help will be greatly appreciated...
Answer by allenallenallen · Aug 11, 2015 at 01:10 AM
I would use EventTrigger. Use Pointer Enter and run the script necessary.
https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-events-and-event-triggers
the problem is that i'm not using that UI... and i cant attach a script to the handle... what i am doing is a editor extension... a tile mapper that runs on edit mode... i'm using the handles like this...
private void OnSceneGUI (){
for (i=0; i<gridSize.x; i++) {
for (j=0; j<gridSize.y; j++) {
if (Handles.Button(handlePosition, handleRotation, handleWidth, handleHeigth, Handles.DotCap)) {
//logic here
}
}
}
}