Hi all.
i was trying my best not too ask question. but i could not get it to work. been working on asset bundle for sometime now. i was able to create the asset bundle and it work perfectly with osx and web. but i can’t get it to load on on the iPhone. look around for the answer, and here what i found. http://www.chrisdanielson.com/2011/05/03/unity3d-file-assetbundles-on-the-iphone/
but it does not seem to load in local and web. and i wondering if you guys let me know what did i do wrong. i know apple stick us from assess var/mobile… so is there any way i can make it work?
P.s. i already build the asset success and i try to place it in Xcode. thank in advance.
Thank in advance.
Here my loading code
using System;
using UnityEngine;
using System.Collections;
public class Example : MonoBehaviour {
private WWW www;
private AssetBundleRequest gameObjectRequest;
// Use this for initialization
IEnumerator Start () {
//TODO: change the name of the file below!!!
String strPath = “file://” + Application.dataPath + “/…/iphone-prefab-sphere.assetbundle”;
Debug.Log(strPath);
www = new WWW(strPath);
yield return www;
/* TODO: change the name “Box” to match the name of your prefab that you compiled into the assetbundle on step 1. */
//AssetBundleRequest request = www.assetBundle.LoadAsync(“Sphere”, typeof(GameObject));
yield return request;
Instantiate(request.asset, new Vector3(3f, 0f, 0f), Quaternion.identity);
Instantiate(request.asset, new Vector3(0f, 0f, 0f), Quaternion.identity);
Instantiate(request.asset, new Vector3(-3f, 0f, 0f), Quaternion.identity);
www.assetBundle.Unload(true);
}
void Update() { }
}