- Home /
Question by
pahe · Dec 06, 2012 at 11:00 AM ·
iphoneassetbundlessimulator
Assetbundles iOS Simulator question
Hi.
I'm currently loading my assetbundles on iOS with the following code:
string pathWithFile = "file://" + Directory.GetParent(Application.dataPath).FullName + "/" + "CharacterElementDatabase.assetbundle";
string pathWithoutFile = AssetbundleURLToCharacterElementDataBase + "CharacterElementDatabase.assetbundle";
Debug.Log("path with file: " + pathWithFile);
Debug.Log("file exists with file: " + File.Exists(pathWithFile)); // results in "false" on simulator and "true" on ios device
Debug.Log("path without file: " + pathWithoutFile);
Debug.Log("file exists without file: " + File.Exists(pathWithoutFile)); // results in "true" on simulator and "false" on ios device
characterElementDatabase = new WWW(pathWithoutFile); // should find the file, but results in "Failed to load asset bundle".
So here's the problem. Although the simulator finds the file it couldn't load the assetbundle. The same code (without the "file://" at start) works fine on my iOS device.
The assetbundles are build with BuildTarget.iPhone so this should not be the problem.
Any thought's or hints about that?
Best thanks and regards, pahe
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613085036im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can Unity 3 build for the iOS Simulator? 2 Answers
Initial Setup with Unity3d and Iphone Question 0 Answers
does ios require physical phone 1 Answer
How to test on iOS simulator? 1 Answer
iPhone Unity Simulator Crashes 1 Answer