A noob really need help here... I keep getting this error log:
IndexOutOfRangeException: Array index is out of range.
..
loadAssets.Start () (at Assets/loadAssets.cs:42)
And the script:
void Start()
{
simpleCloudHandler = otherGameObject.GetComponent();
string bundleurl = simpleCloudHandler.mTargetMetadata;
WWW www = new WWW(bundleurl);
StartCoroutine(LoadRestaurant(www));
}
IEnumerator LoadRestaurant(WWW www)
{
yield return www;
AssetBundle bundle = www.assetBundle;
if (www.error == null)
{
GameObject restaurant = (GameObject)bundle.LoadAsset(bundle.name);
Instantiate(restaurant);
}
else
{
Debug.Log(www.error);
}
}
}
↧