Hey everyone, I’m having issues with Undos not registering in a custom Editor Window. I’m relatively new to working with Serialized Objects and Serialized Properties, but from what I’ve seen shouldn’t they work with the Undo system automatically. Is my setup wrong or should this be working? Here is a stripped-down version of what my setup looks like:
public class TestEditorWindow : EditorWindow
{
private SerializedObject m_scriptableObject;
private SerializedProperty m_testFloatProperty;
private void LoadScriptableObject()
{
m_testFloatProperty = m_scriptableObject.FindProperty("testFloatProperty");
}
private void OnGUI()
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_testFloatProperty);
if (EditorGUI.EndChangeCheck())
{
m_scriptableObject.ApplyModifiedProperties();
}
}
}