I am trying to intercept the left click event when editing a component in the scene view. The editor is supposed to add a way point on the scene whenever the user clicks however it seems to add the waypoint as expected then switch the focus to the gameObject that was underneath the mouse cursor. Is it possible to intercept the click action to not switch to another gameObject?
The Events I am using are as follows:
void OnSceneGUI()
{
if (Event.current.type == EventType.MouseDown)
{
// Add waypoint logic...
Event.current.Use();
}
}
I have also tried MouseUp and both MouseUp and MouseDown with Event.current.Use to no avail. Is it also possible to specify which mouse button the event corresponds to?