Search Issue Tracker
Fixed in 2021.2.X
Votes
0
Found in
2020.2
2020.2.0f1
2021.1
2021.2
Issue ID
1304102
Regression
No
DontSaveInEditor and NotEditable flags are not automatically added to the Asset when using OnPostprocessPrefab method
Reproduction steps:
1. Open the user's attached project
2. In the Project window, select SamplePrefab
3. In the Inspector window, observe the values of Sample Property 1 and Sample Property 2
4. Select Open Prefab and observe the values of Sample Property 1 and Sample Property 2
5. In the Project window, select SamplePrefab again and change Sample Property 2 value to Test (or anything else)
6. Save the changes and select Open Prefab
7. Observe the values of Sample Property 1 and Sample Property 2
Expected result: Sample Property 1 is "original value" and Sample Property 2 is "Test"
Actual result: Sample Property 1 is "processed value 1" and Sample Property 2 is "Test"
Reproducible with: 2020.2.0a10, 2020.2.2f1, 2021.1.0b2, 2021.2.0a2
Could not test with: 2018.4.31f1, 2019.4.19f1, 2020.2.0a9 (OnPostprocessPrefab() is not triggered and does not have an effect on non-original prefab)
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
- GfxDevice::UpdateBufferRanges when running UIBuilder tests
- [Android][BiRP] Depth processing is handled incorrectly on certain Android devices when using 2 camera's
- [APV] Cancelling Display Dialog Error is thrown after Adaptive Probe Volumes tab is open in Lighting Window
- [APV] NullReferenceException is thrown when baking Adaptive Probe Volume for a Terrain with Non-GI Contributing Tree Prototypes and multiple APV objects with different LayerMasks are present on the scene
- Hands are not recognized when using Hololens 2
Resolution Note (fix version 2021.2):
The behavior is correct, documentation says:
The postprocessor can set or modify hideflags on objects in the Prefab. Asset objects always get the DontSaveInEditor and NotEditable flags added. GameObjects and Components always get the DontSaveInEditor flag added. The DontSaveInEditor flag is always set to avoid the object from being saved back into the Prefab source asset, because this duplicates the generated objects every time the Prefab is saved.
https://docs.unity3d.com/2020.2/Documentation/ScriptReference/AssetPostprocessor.OnPostprocessPrefab.html
The fix for this was typos in the Documentation.