Hello there. I just trying to load different types of resources using Resources.Load method.
In Editor it works fine but when I make some build (windows standalone or iOS) - Resources.Load every time returns Null and I just cant load any resource.
Why it so? How to fix it?
Here is more info.
I wrote a code which shows me if the resource was downloaded or not.
BGArt = (Sprite)Resources.Load(app.model.pathTrialImages+BackgroundArt, typeof(Sprite));
if (i < 5)
{
if (!BGArt)
Debug.LogError(app.model.pathTrialImages + BackgroundArt + " value: " + BGArt);
var bga = Resources.Load(app.model.pathTrialImages + BackgroundArt, typeof(Sprite));
Debug.LogError("---var---: " + app.model.pathTrialImages + BackgroundArt + " value: " + bga);
i++;
}
And here is Debug.Log in Editor
all right…
But in builded EXE…

As you can see, in build assets just don’t uploads
About TextAsset - early I could not download it, but this code fixed it.
TextAsset ta = (TextAsset)Resources.Load("data", typeof(TextAsset));
string data = ta.text;
But with rest of assets it did not help.
About different types of Resources.Load -
I just try all (or not all?) types of that method. See code below
BGArt = (Sprite)Resources.Load(app.model.pathTrialImages+BackgroundArt, typeof(Sprite));
if (i < 10)
{
Debug.LogError("-----I: " + i + "----- START");
Debug.LogError("Type name = (Type)Resources.Load(path, Type) value: " + BGArt);
var bga = Resources.Load(app.model.pathTrialImages + BackgroundArt, typeof(Sprite));
Debug.LogError("var name = Resources.Load("+ app.model.pathTrialImages + BackgroundArt + ", Type) value: " + bga);
var bga1 = Resources.Load<Sprite>(app.model.pathTrialImages + BackgroundArt);
Debug.LogError("var name = Resources.Load<Type>("+ app.model.pathTrialImages + BackgroundArt + ") value: " + bga1);
Sprite bga2 = Resources.Load<Sprite>(app.model.pathTrialImages + BackgroundArt);
Debug.LogError("Type name = Resources.Load<Type>(" + app.model.pathTrialImages + BackgroundArt + ") value: " + bga2);
Sprite bga3 = Resources.Load<Sprite>(app.model.pathTrialImages + BackgroundArt+".jpg");
Debug.LogError("Type name = Resources.Load<Type>(" + app.model.pathTrialImages + BackgroundArt + ".jpg" + ") value: " + bga3);
Debug.LogError("-----I: " + i + "----- END
");
i++;
}
So I’m trying to download batch of sprites, and for first 10 of them I do Debug.Log().
Here is log for first three sprites
-----I: 0----- START
Type name = (Type)Resources.Load(path, Type) value:
var name = Resources.Load(images/iphone/iphone_6/game/trial/pg1pt01, Type) value:
var name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/pg1pt01) value:
Type name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/pg1pt01) value:
Type name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/pg1pt01.jpg) value:
-----I: 0----- END
-----I: 1----- START
Type name = (Type)Resources.Load(path, Type) value:
var name = Resources.Load(images/iphone/iphone_6/game/trial/pg2pt01, Type) value:
var name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/pg2pt01) value:
Type name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/pg2pt01) value:
Type name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/pg2pt01.jpg) value:
-----I: 1----- END
-----I: 2----- START
Type name = (Type)Resources.Load(path, Type) value:
var name = Resources.Load(images/iphone/iphone_6/game/trial/previous kept, Type) value:
var name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/previous kept) value:
Type name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/previous kept) value:
Type name = Resources.Load<Type>(images/iphone/iphone_6/game/trial/previous kept.jpg) value:
-----I: 2----- END
All Resources,Load() returns Null.