Possible to find what control was changed after EndChangeCheck?

Going out on a limb here, but does anyone know if it’s possible to know what control/value was changed after a EndChangeCheck() call?

e.g:

EditorGUI.BeginChangeCheck();

EditorGUILayout.PropertyField(myProperty); //this is a property which contains other properties, which contain even more properties.

if (EditorGUI.EndChangeCheck()) {

//some value was changed, but what could it be???
}

One idea I had was to construct a property/value map before drawing the field, then comparing that property/value map to the property after a change is detected. However, I haven’t been able to get values before they change. Every time I compare my values, they always equal the changed value. Maybe there’s some event I can check for before a property is modified?

Another solution is to manually draw the children of the property and check changes per child. This works, but… not when the property has a CustomPropertyDrawer.

In other words. I don’t think it’s possible.

Hey there,

The changed check just works by every control setting GUI.changed = true when their value has changed. This would not give you the name of the control since it’s just a bool. You can however use the hotControl to find out which element is focused. Then when the GUI is changed; check the hotControl. If you map this back to the control you will know which one has changed.

Cheers,

Thanks, How does one map the hotControl back to a control?

I see GUIUtility.QueryStateObject(type, controlId)

but this assumes I know the type, which I don’t. And in any case, the result is always an exception.