Search Issue Tracker
Fixed in 2021.2.X
Votes
3
Found in
2019.3.0b11
2019.4.2f1
2020.1.0a13
2020.2
Issue ID
1267939
Regression
Yes
Resources.Load returns 'False' in OnPostprocessAllAssets when the Asset was externally changed and loaded in [InitializeOnLoad]
How to reproduce:
1. Open user-submitted project (Initialize Resources Bug.zip)
2. See the Console window - load result is 'True'(if due to project upgrading/downgrading it's False - restart the Editor)
3. Close the Editor
4. Open Assets/Resources/SampleAsset.asset with a text editor
5. Change the last line(numberField: 2) into another number and save
6. Launch the project again and see the load result
Expected result: load result returns 'True'
Actual result: load result returns 'False'
Reproducible with: 2019.3.0b11, 2019.4.7f1, 2020.1.0a13, 2020.1.1f1, 2020.2.0a20
Not reproducible with: 2018.4.26f1, 2019.3.0b10, 2020.1.0a1, 2020.1.0a12
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note (fix version 2021.2):
This is by design - you can't expect to be able to load assets in this callback. Assets get imported after the domain has been loaded. You would get the same kind load failure, if the library folder was deleted.
Instead a new variant of OnPostProcessAllAssets has been added in 2022.1.0a7. This new version includes a didDomainReload boolean to signal if there has been a domain reload. Asset loading is safe in this callback. API documentation has been updated with information about this.
Resolution Note (fix version 2021.2):
A new variant of OnPostProcessAllAssets has been added in 2021.2.0b12. This new version includes a didDomainReload boolean to signal if there has been a domain reload. Asset loading is safe in this callback.