Search Issue Tracker
By Design
Votes
0
Found in
5.5.1f1
Issue ID
902926
Regression
No
"Scene(s) Have Been Modified" is not shown when Scene was modified from Script
User is not asked whether to save scene modifications or not when closing the scene, which was modified from the script (run from the Context Menu).
To reproduce:
1. Open the scene on the attached project
2. Select the "Particle System" GameObject
3. View that the value of the "Order in Layer" in the Renderer module is 0
4. Select the "ParticleBugTest" GameObject
5. Right-click the "Particle Bug Test" script and select "Test" (it changes the "Particle System" GameObject sorting layer to 15)
6. Exit the Unity editor
Desired outcome: "Scene(s) Have Been Modified" dialog is shown before closing the editor.
Actual result: Editor closes without saving the modifications.
Workaround: Editing values manually (not from the script) provokes "Scene(s) Have Been Modified" dialog to appear when the modified scene is being closed.
Reproduced with 5.5.1f1, 5.5.3p1, 5.6.0p2, 2017.1.0b1
---
When modifying a prefab from script, in order to store those modifications, the prefab instance needs to be told that something was changed by calling
https://docs.unity3d.com/ScriptReference/PrefabUtility.RecordPrefabInstancePropertyModifications.html
Better yet, SerializeObject and SerializedProperty can be used instead, giving Undo and Prefab support automatically https://docs.unity3d.com/ScriptReference/SerializedObject.html.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Joint Physics result in unexpected behaviors when used for articulated vehicles like buses or trucks
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts which worked with TMP Font Asset Creator
Add comment