The following code works in earlier versions of Unity but seems broken in several versions of 2017. I can’t find anything in the docs about these functions not working in OnSceneGui anymore. They do seem to work in OnGUI in regards to text boxes and other controls. The problem is I need to find out which handle is currently selected.
void OnSceneGUI(SceneView sceneView)
{
float size = HandleUtility.GetHandleSize(Vector3.zero) * 0.3f;
GUI.SetNextControlName(“Handle1”);
Handles.FreeMoveHandle(Vector3.zero,Quaternion.identity, size, Vector3.one, Handles.SphereCap);
Debug.Log(GUI.GetNameOfFocusedControl());
}
Any idea why GetNameOfFocusedControl() always returns a blank string now in 2017?