赞
踩
加载包的时候要同时加载它依赖的包,否则会丢失(以下为本地加载)
获取Manifest:
获取Manifest中所有的包:
- foreach (string name in manifest.GetAllAssetBundles())
- {
- print(name);
- }
获取中Manifest中的依赖:
”assetBundle“参数是固定的
根据包的依赖加载包:
- AssetBundle assetBundle = AssetBundle.LoadFromFile(manifestFilePath);
- AssetBundleManifest manifest = assetBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
- string[] dependencies = manifest.GetAllDependencies("assetBundle"); //Pass the name of the bundle you want the dependencies for.
- foreach(string dependency in dependencies)
- {
- AssetBundle.LoadFromFile(Path.Combine(assetBundlePath, dependency));
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。