예제 #1
0
        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);
            }
        }
예제 #2
0
 /// <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);
     }
 }
예제 #3
0
 /// <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);
     }
 }