Search Issue Tracker
By Design
Votes
0
Found in
2019.3.15f1
2020.1.0b10
2020.1.0b11
2020.2
Issue ID
1254464
Regression
Yes
Loading Prefab in InitializeOnLoad returns null when it contains components from a different asmdef
To reproduce:
1. Open attached project ('case_1254464.zip')
2. Observe the Console window
Expected result: Message 'Load: exists(True), loaded(True)' is printed
Actual result: Error 'Load: exists(True), loaded(False)' is printed
Reproducible in: 2019.3.15f1, 2019.4.1f1, 2020.1.0b10, 2020.1.0b13, 2020.2.0a15
Not reproducible in: 2018.4.23f1, 2019.3.14f1, 2020.1.0a1, 2020.1.0b9
Notes:
1. Moving the component to the same assembly the AssetLoader is in prevents the issue
2. LoadAllAssetsAtPath does return the GameObject
3. Loading later (e.g. EditorApplication.update) works
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
- Audio Mixer window cannot be scrolled when naming items
- [Android][Vulkan] Mesh flickers in portrait when Box Projection and Use Rendering Layers are enabled on Vulkan API with specific geometry in scene
- Scrollbar remains visible in the Imported Assets tab table after removing all columns
- Crash on MemoryManager::OutOfMemoryError when building a specific project for Android platform
- “NullReferenceException: Object reference not set to an instance of an object” error is thrown and no Neighbor Terrain is created when using “Create Neighbor Terrains” tool in Additional Editor Instance window
Resolution Note:
Cannot reliably load non-script assets on [InitializeOnLoad] because it is called before regular assets like prefabs are imported.