|
@@ -465,6 +465,7 @@ namespace ET
|
|
|
{
|
|
{
|
|
|
async ETTask LoadDependency(string dependency, List<ABInfo> abInfosList)
|
|
async ETTask LoadDependency(string dependency, List<ABInfo> abInfosList)
|
|
|
{
|
|
{
|
|
|
|
|
+ Log.Debug($"111111111111111111111111111111111111ggggg1");
|
|
|
CoroutineLock coroutineLock = null;
|
|
CoroutineLock coroutineLock = null;
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
@@ -486,11 +487,11 @@ namespace ET
|
|
|
// LoadFromFileAsync部分可以并发加载
|
|
// LoadFromFileAsync部分可以并发加载
|
|
|
using (ListComponent<ETTask> tasks = ListComponent<ETTask>.Create())
|
|
using (ListComponent<ETTask> tasks = ListComponent<ETTask>.Create())
|
|
|
{
|
|
{
|
|
|
|
|
+ Log.Debug($"111111111111111111111111111111111111ggggga1");
|
|
|
foreach (string dependency in dependencies)
|
|
foreach (string dependency in dependencies)
|
|
|
{
|
|
{
|
|
|
tasks.Add(LoadDependency(dependency, abInfos.List));
|
|
tasks.Add(LoadDependency(dependency, abInfos.List));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
await ETTaskHelper.WaitAll(tasks.List);
|
|
await ETTaskHelper.WaitAll(tasks.List);
|
|
|
|
|
|
|
|
// ab包从硬盘加载完成,可以再并发加载all assets
|
|
// ab包从硬盘加载完成,可以再并发加载all assets
|
|
@@ -499,7 +500,6 @@ namespace ET
|
|
|
{
|
|
{
|
|
|
tasks.Add(LoadOneBundleAllAssets(abInfo));
|
|
tasks.Add(LoadOneBundleAllAssets(abInfo));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
await ETTaskHelper.WaitAll(tasks.List);
|
|
await ETTaskHelper.WaitAll(tasks.List);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -515,7 +515,7 @@ namespace ET
|
|
|
//Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
|
|
//Log.Debug($"---------------load one bundle {assetBundleName} refcount: {abInfo.RefCount}");
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ Log.Debug($"111111111111111111111111111111111111gggggdddddd1");
|
|
|
string p = "";
|
|
string p = "";
|
|
|
AssetBundle assetBundle = null;
|
|
AssetBundle assetBundle = null;
|
|
|
|
|
|
|
@@ -548,13 +548,11 @@ namespace ET
|
|
|
return abInfo;
|
|
return abInfo;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
p = Path.Combine(PathHelper.AppHotfixResPath, assetBundleName);
|
|
p = Path.Combine(PathHelper.AppHotfixResPath, assetBundleName);
|
|
|
if (!File.Exists(p))
|
|
if (!File.Exists(p))
|
|
|
{
|
|
{
|
|
|
p = Path.Combine(PathHelper.AppResPath, assetBundleName);
|
|
p = Path.Combine(PathHelper.AppResPath, assetBundleName);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
Log.Debug("Async load bundle BundleName : " + p);
|
|
Log.Debug("Async load bundle BundleName : " + p);
|
|
|
|
|
|
|
|
// if (!File.Exists(p))
|
|
// if (!File.Exists(p))
|
|
@@ -562,16 +560,13 @@ namespace ET
|
|
|
// Log.Error("Async load bundle not exist! BundleName : " + p);
|
|
// Log.Error("Async load bundle not exist! BundleName : " + p);
|
|
|
// return null;
|
|
// return null;
|
|
|
// }
|
|
// }
|
|
|
-
|
|
|
|
|
assetBundle = await AssetBundleHelper.UnityLoadBundleAsync(p);
|
|
assetBundle = await AssetBundleHelper.UnityLoadBundleAsync(p);
|
|
|
-
|
|
|
|
|
if (assetBundle == null)
|
|
if (assetBundle == null)
|
|
|
{
|
|
{
|
|
|
// 获取资源的时候会抛异常,这个地方不直接抛异常,因为有些地方需要Load之后判断是否Load成功
|
|
// 获取资源的时候会抛异常,这个地方不直接抛异常,因为有些地方需要Load之后判断是否Load成功
|
|
|
Log.Warning($"assets bundle not found: {assetBundleName}");
|
|
Log.Warning($"assets bundle not found: {assetBundleName}");
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
abInfo = this.AddChild<ABInfo, string, AssetBundle>(assetBundleName, assetBundle);
|
|
abInfo = this.AddChild<ABInfo, string, AssetBundle>(assetBundleName, assetBundle);
|
|
|
this.bundles[assetBundleName] = abInfo;
|
|
this.bundles[assetBundleName] = abInfo;
|
|
|
return abInfo;
|
|
return abInfo;
|