I can’t seem to get EditorGUI.BeginChangeCheck() and EditorGUI.EndChangeCheck() to properly save changes made to a EditorGUILayout.Popup(). Here’s my block of code, running inside OnInspectorGUI() of a Custom Editor.
EditorGUI.BeginChangeCheck();
useTextBank.selectedBank = EditorGUILayout.Popup(useTextBank.selectedBank, useTextBank.textBank.bankSets [0].textItems.ToArray());
if (EditorGUI.EndChangeCheck()) {
useTextBank.RefreshText();
Undo.RecordObject(useTextBank, "Select TextBank");
}
I’m trying to match the usage defined here: Unity - Scripting API: EditorGUI.BeginChangeCheck but the modified object doesn’t not save with scene/prefab after modifying it’s popup in the inspector, nor does an Undo entry get created. I’m using Unity 5.6.4.