Search Issue Tracker
PrefabUtility.SaveAsPrefabAsset() freezes the editor when called from OnValidate() method
1. Open any project
2. Import the script attached "CreatePrefab.cs" (or make your own: call PrefabUtility.SaveAsPrefabAsset() from method OnValidate())
3. Assign the script to a game object and pick a game object for the script's public field (ex.: freshly created 3d object)
Result: editor freezes on trying to validate script after changes have been made
Reproduced in: 2018.3.7f1, 2019.1.0b5, 2019.2.0a6
Note1: OnValidate() can also be checked by commenting out PrefabUtility.SaveAsPrefabAsset(), adding GameObject to script's public field and decommenting. OnValidate
will once again freeze the editor.
Note2: PrefabUtility not available on LTS
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Mac] Unity Hub encounters a critical error when trying to launch it after logging out
- [XR SDK | GLES] large gpu perf regression ~3 ms
- UploadHandlerFile.contentType cannot be set and always returns "text/plain"
- [XR][URP][Shader Graph][Android] Shader graph shaders are not rendering on Android when using texture array layout (multiview)
- Cloth behaving different after upgrading to 2019.2.9 from 2018.3