public void UnloadBundle(string assetBundleName)
        {
            assetBundleName = assetBundleName.BundleNameToLower();

            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 ETTask 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);
     }
 }
Esempio n. 3
0
        public K GetUnitRefrenceById <K>(string unitId, EntityType entityType) where K : class
        {
            string assetBundleName = $"unit/{AssetBundleHelper.GetBundleNameById(unitId, entityType)}";

            return(GetAsset <K>(assetBundleName, unitId));
        }