Android : AssetBundle loading model is not showing in mobile

on Friday, January 30, 2015


0 I'm loading 3d model from server url and using assetbundle but when i load the model in unityeditor it's working fine and the 3d model of cube is displaying proper. But when i load the model in android mobile the model is not displaying in the screen.



IEnumerator GetAssetBundle() {

string bundleURL = url;

Debug.Log (bundleURL);
using (WWW www = WWW .LoadFromCacheOrDownload(bundleURL, Version)) {
yield return www;
Debug.Log (Version);

if (www .error != null)
throw new UnityException("WWW Download had an error: " + www .error);

AssetBundle bundle = www .assetBundle;
if (AssetName == "") {
Debug.Log ("null");
mBundleInstance = Instantiate (bundle.mainAsset) as GameObject;
mBundleInstance.transform.parent = imageTarget.transform;
mBundleInstance.transform.localPosition = new Vector3(0,0,0);


}
else {
Debug.Log ("not null");
mBundleInstance = Instantiate(bundle.Load (AssetName)) as GameObject;
}
}
}

0 comments:

Post a Comment