Search Issue Tracker
Won't Fix
Votes
1
Found in
2018.3.0a6
2018.3.0f2
2019.1.0a1
Issue ID
1112654
Regression
No
EditorGUILayout.EnumPopup doesn't save changes from prefab edit mode when Undo.RecordObject is disabled
Steps to reproduce:
1. Open the original project "PrefabsBug.Unity.zip"
2. Go to Project window Assets->Prefabs
3. Double click on the "Test Target"
4. In the Inspector disable Undo.RecordObject by pressing on the green button
5. Expand "Sample Enum" and select any given option
6. Exit Prefab edit mode
7. Go back to Prefab edit mode and notice how Sample Enum value was not saved
Expected results: EnumPopup value changes are saved in Prefab edit mode
Actual results: EnumPopup value changes are not saved in Prefab edit mode
Reproducible with: 2018.3.0a6, 2018.3.2f1, 2019.1.0a13
Note: Improved prefabs were introduced in 2018.3.0a6
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2019.2.X):
The reason this does not work is because the user is not marking the scene dirty, nor is he marking the object that is changed dirty. He needs to at least do one of those.
I changed the inspector script to look like this and now it works
EditorGUI.BeginChangeCheck();
_src.sampleEnum = (TextAnchor)EditorGUILayout.EnumPopup("Sample Enum", _src.sampleEnum);
if (EditorGUI.EndChangeCheck())
EditorUtility.SetDirty(_src);