Hi every one, im trying to donwload asset bundle and then instantiate any gameobject from that. But i dont understand what im doing wrong. i was watching some tutorials, but still doeanst work. Canu help me pls?
When im strarting Scene console write me this error :
NullReferenceException: Object reference not set to an instance of an object
loadAsset+c__Iterator0.MoveNext () (at Assets/Scripts/loadAsset.cs:16)
and here is my script :
using UnityEngine;
using System.Collections;
public class loadAsset : MonoBehaviour {
private string url = "https://www.dropbox.com/s/juk97y0ovyruhpc/skuska.unity3d";
IEnumerator Start () {
WWW www = WWW.LoadFromCacheOrDownload (url,1);
yield return www;
AssetBundle bundle = www.assetBundle;
GameObject kocka = bundle.Load("Cube", typeof(GameObject)) as GameObject;
Instantiate(kocka);
kocka.transform.Translate (new Vector3(1,1,1));
}
}
i was trying to use other server but still doeasnt work.
Can u help with my problem?
oh sure script its name is “ExportAssetBundles” i have in Editor Folder in my project.
Thanks Thomas