I have been trying to use AssetBundle for some time. To my misfortune I can’t get it to work on the device.
I have created 2 bundles one for WP8 and the other for PC, the bundle contains just 3D models and NO scripts whatsoever.
The PC one works well in the editor whereas the WP8 bundle loads but does not Instantiate on device.
I have checked the logs for any sort of error or null reference but could not find anything.
Here is my code to download and instantiate the assetbundle.
void Start (){
StartCoroutine(load(loadUrl, 2));
}
private IEnumerator load(string url, int version) {
// wait for the caching system to be ready
using (WWW www = new WWW(url)) {
wwwT = www; //This definition is used to get the progress which is accessed in the OnGUI
yield return www;
if (www.error != null)
throw new Exception("WWW download had an error:" + www.error);
AssetBundle bundle = www.assetBundle;
Instantiate(bundle.mainAsset);
Debug.Log("INSTANTIATE!");
flag = false;
// Unload the AssetBundles compressed contents to conserve memory
//bundle.Unload(false);
}
Thanks in Advance,
Stanley J. Maliackal