I have trouble implementing ‘undo’ for a few of my config assets (ScriptableObject’s).
[CustomEditor(MyConfig)]
class MyConfigEditor (Editor):
config as MyConfig
def Awake():
config = target as MyConfig
def OnInspectorGUI():
if GUILayout.Button("Change config"):
Undo.RegisterUndo(config, "Changed config")
... changing the config
EditorUtility.SetDirty(config)
It seems like undo operations are reflected in the file system, but not in the inspector.