How do I determine the ID of the last drawn GUI control? I’d like to be able to do something along these lines:
myObject.expanded = EditorGUILayout.Foldout(myObject.expanded, myObject.label);
int id = ???get control ID???;
if (GUI.hotControl == id) {
// do something
}
For example, I might want to render the foldout’s ‘child’ elements differently if the foldout is ‘hot’.
Is there such a function? Or, perhaps, a way to specify the ID for the next control, as GUI.SetNextControlName() does for the string identifier?