Hello!
I have strange problem with Resources.Load. I have prefab within Resource folder. That prefab loading fine… but not always. Sometimes it load. Sometimes not. I verified what happens and it seems sometimes Resources.Load doesn’t see any prefab within resource folder!! I tried load all resources and see what I have:
var objects = Resources.LoadAll("");
string error = "";
foreach (var o in objects)
{
string assetPath = AssetDatabase.GetAssetPath(o);
if (assetPath.Contains("Assets/*****/Resources"))
{
error += $"assetPath {assetPath} Object = {o}
";
}
}
If all works as it should code show prefabs in selected list. But if Resources.Load failed, in that list I don’t see a single prefab.
Any idea what it could be? Unity version 2019.4.16