level 4
黄蓉无敌
楼主
我这有个方法,需要用www读取assetbundle,然后再把bundle返回,可是 www是异步的 ,直接返回的bundle总是空的怎么办?如果用IEnumerator 可以用yeild return ,但是没法返回 bundle 了,求助应该怎么写呢到底?代码如下:
AssetBundle builder = LoadBundle(path);
public AssetBundle LoadBundle(string name) {
AssetBundle bundle = null;
string uri = DataPath + name + ".unity3d";
WWW www = new WWW(uri);
bundle = http://www.assetBundle;
//这里等待读完
return bundle;
}
目前不知道怎么写让他等待读完这里。。。请教各位大神
2015年05月20日 09点05分
1
AssetBundle builder = LoadBundle(path);
public AssetBundle LoadBundle(string name) {
AssetBundle bundle = null;
string uri = DataPath + name + ".unity3d";
WWW www = new WWW(uri);
bundle = http://www.assetBundle;
//这里等待读完
return bundle;
}
目前不知道怎么写让他等待读完这里。。。请教各位大神