Quantcast
Channel: Questions in topic: "build"
Viewing all articles
Browse latest Browse all 4084

Why Resources.Load does not works in Build?

$
0
0
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 + " \t value: " + BGArt); var bga = Resources.Load(app.model.pathTrialImages + BackgroundArt, typeof(Sprite)); Debug.LogError("---var---: " + app.model.pathTrialImages + BackgroundArt + "\t value: " + bga); i++; } And here is Debug.Log in Editor ![alt text][1] all right... But in builded EXE.. ![alt text][2] As you can see, in build assets just don't uploads [1]: /storage/temp/56703-ss-2015-10-22-at-045117.png [2]: /storage/temp/56704-ss-2015-10-22-at-045428.png 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)\t value: " + BGArt); var bga = Resources.Load(app.model.pathTrialImages + BackgroundArt, typeof(Sprite)); Debug.LogError("var name = Resources.Load("+ app.model.pathTrialImages + BackgroundArt + ", Type) \t value: " + bga); var bga1 = Resources.Load(app.model.pathTrialImages + BackgroundArt); Debug.LogError("var name = Resources.Load("+ app.model.pathTrialImages + BackgroundArt + ") \t value: " + bga1); Sprite bga2 = Resources.Load(app.model.pathTrialImages + BackgroundArt); Debug.LogError("Type name = Resources.Load(" + app.model.pathTrialImages + BackgroundArt + ") \t value: " + bga2); Sprite bga3 = Resources.Load(app.model.pathTrialImages + BackgroundArt+".jpg"); Debug.LogError("Type name = Resources.Load(" + app.model.pathTrialImages + BackgroundArt + ".jpg" + ") \t value: " + bga3); Debug.LogError("-----I: " + i + "----- END\n"); 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(images/iphone/iphone_6/game/trial/pg1pt01) value: Type name = Resources.Load(images/iphone/iphone_6/game/trial/pg1pt01) value: Type name = Resources.Load(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(images/iphone/iphone_6/game/trial/pg2pt01) value: Type name = Resources.Load(images/iphone/iphone_6/game/trial/pg2pt01) value: Type name = Resources.Load(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(images/iphone/iphone_6/game/trial/previous kept) value: Type name = Resources.Load(images/iphone/iphone_6/game/trial/previous kept) value: Type name = Resources.Load(images/iphone/iphone_6/game/trial/previous kept.jpg) value: -----I: 2----- END All Resources,Load() returns Null.

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>