- Home /
Resources.Load() doesn't find file right after file creation. How can I get around this?
I copy a file from another location the "Resource" folder and after that I try to load this file by using Load.Resources(). The file won't be found, but I have to wait some time till it's recognized by the system. I'm using a coroutine to wait for that but is there any way of loading a file instantly?
Maybe it takes some time till the corresponding .meta file is created so it will be recognized (I don't know). So maybe I should try to load it from an other folder ¯_(ツ)_/¯
Answer by CodesCove · Jan 23, 2021 at 07:49 AM
Suggestion: Use AssetPostprocessor.OnPostprocessxxxxx to check when asset is available. Also check this setting: Edit --> Preferences --> General --> Auto refersh
Check out here how to use AssetPostprocessor.OnPostprocessAllAssets
that basically is called if any type of asset is copied / imported to any of the project folders and has been processed to be available.
https://docs.unity3d.com/ScriptReference/AssetPostprocessor.OnPostprocessAllAssets.html
Your answer
