AssetBundle类加载本地AssetBundle
void  LoadForAssetBundle(){
	string filePath = "D:/Documents/Study/Assets/14/AssetBundle/ppp.assetbundle";
	AssetBundle bundle =  AssetBundle.LoadFromFile (filePath);
	Object player = bundle.LoadAsset ("Player");
	Instantiate (player);
	bundle.Unload (false);
}

不需要等待,直接使用AssetBundle的静态方法LoadFromFile直接得到AssetBundle

通过LoadAsset("资源名字"),加载AssetBundle里面的资源

Unload()方法传递一个bool值,true表示释放全部,false表示释放没有用到的


首页 我的博客
粤ICP备17103704号