public void UnloadAssetBundle(AssetBundlePackage bundle, bool b = true) { if (bundle != null && !string.IsNullOrEmpty(bundle.name)) { //HFLog.L("卸载Assetbundle " + bundle.name); allAssetBundleDic.Remove(bundle.name); bundle.Unload(b); } }
/// <summary> /// 卸载某一个 assetbundle 通过名字 /// </summary> /// <param name="name"></param> /// <param name="b">是否卸载压出来的的东西</param> public void UnloadAssetBundle(string name, bool b = true) { name = name.ToLower(); AssetBundlePackage bundle = GetAssetBundle(name); if (bundle != null) { //HFLog.L("卸载Assetbundle " + bundle.name); RecursionReleaseAssetBundle(bundle.name); bundle.Unload(b); allAssetBundleDic.Remove(name); } }