public void UnloadBundle(string assetBundleName) { assetBundleName = assetBundleName.ToLower(); string[] dependencies = AssetBundleHelper.GetSortedDependencies(assetBundleName); //Log.Debug($"-----------dep unload {assetBundleName} dep: {dependencies.ToList().ListToString()}"); foreach (string dependency in dependencies) { this.UnloadOneBundle(dependency); } }
/// <summary> /// 异步加载assetbundle /// </summary> /// <param name="assetBundleName"></param> /// <returns></returns> public async Task LoadBundleAsync(string assetBundleName) { assetBundleName = assetBundleName.ToLower(); string[] dependencies = AssetBundleHelper.GetSortedDependencies(assetBundleName); // Log.Debug($"-----------dep load {assetBundleName} dep: {dependencies.ToList().ListToString()}"); foreach (string dependency in dependencies) { if (string.IsNullOrEmpty(dependency)) { continue; } await this.LoadOneBundleAsync(dependency); } }
/// <summary> /// 同步加载assetbundle /// </summary> /// <param name="assetBundleName"></param> /// <returns></returns> public void LoadBundle(string assetBundleName, bool IsSprite = false) { assetBundleName = assetBundleName.ToLower(); string[] dependencies = AssetBundleHelper.GetSortedDependencies(assetBundleName); //Log.Debug($"-----------dep load {assetBundleName} dep: {dependencies.ToList().ListToString()}"); foreach (string dependency in dependencies) { if (string.IsNullOrEmpty(dependency)) { continue; } this.LoadOneBundle(dependency, IsSprite); } }