Search Issue Tracker
By Design
Votes
0
Found in
2018.2.0x
Issue ID
1063806
Regression
No
[Backend] PrefabUtility.CreatePrefab returns null when called from ScriptedImporter.OnImportAsset
How to reproduce:
1. Open the "CreatePrefab.zip" project
2. Delete "Assets/MyPrefab" asset
3. MyCustomMenu > Create Prefab, notice that no errors are thrown
4. Delete "Assets/MyPrefab" asset
5. Reimport "Assets/MyCustomAsset", notice the "prefab == null" error
Actual result: PrefabUtility.CreatePrefab references to null if called via ScriptedImporter.OnImportAsset
Expected result: PrefabUtility.CreatePrefab should refer to the recently created prefab
Reproducible with: 2018.3.0a6, 2018.2.0x-ImprovedPrefabs.
Not reproducible with: 2018.2.1f1, 2018.1.9f1, 2017.4.8f1.
Notes:
MyCustomImporter.cs calls "CreatePrefab()" (line 20) function on reimport or when "Create Prefab" menu option is pressed, which creates prefab.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Paste" option is available in Shader Graph contextual menu even when the clipboard has unrelated item
- Editor crashes when debugging a for loop
- Crash on UnityPlayer!profiling::ProfilerManager::DisposeProfilerRecorder+0xa when Player gets relaunched and exited after running for a long amount of time
- [Input system] When releasing one touch and pressing a second touch during a single frame, the second touch is not translated into UI event line OnPointerDown by the InputSystemUIInputModule
- URP Samples - multiple "Attempting to resolve render surface" and other errors appear when setting Quality pipeline asset
Add comment