|
@@ -59,8 +59,11 @@ namespace ET
|
|
|
|
|
|
private async UniTaskVoid AsyncLoadHotfix()
|
|
|
{
|
|
|
+ GlobalConfig globalConfig = Resources.Load<GlobalConfig>("GlobalConfig");
|
|
|
+ Log.Info($"start mode: {globalConfig.PlayMode}");
|
|
|
+
|
|
|
// 启动YooAsset引擎,并在初始化完毕后进行热更代码加载
|
|
|
- await YooAssetProxy.StartYooAssetEngine(YooAssets.EPlayMode.HostPlayMode);
|
|
|
+ await YooAssetProxy.StartYooAssetEngine(globalConfig.PlayMode);
|
|
|
|
|
|
// Shader Warm Up
|
|
|
ShaderVariantCollection shaderVariantCollection =
|
|
@@ -78,12 +81,14 @@ namespace ET
|
|
|
await LoadHotfixCode();
|
|
|
}
|
|
|
|
|
|
- //TODO: AOT dll列表的配置也可以通过热更新下下来,这样增加了新的泛型就不怕了
|
|
|
// 加载assembly对应的dll,会自动为它hook。一旦aot泛型函数的native函数不存在,用解释器版本代码
|
|
|
private async UniTask LoadMetadataForAOT()
|
|
|
{
|
|
|
- HotUpdateAssemblyManifest aotlist = Resources.Load<HotUpdateAssemblyManifest>("HotUpdateAssemblyManifest");
|
|
|
- var DLLNameList_ForABLoad = aotlist.AOTMetadataDlls;
|
|
|
+ //AOT dll列表的配置也可以通过热更新下下来,这样增加了新的泛型就不怕了
|
|
|
+ HotUpdateAssemblyManifest mainfest =
|
|
|
+ (await YooAssetProxy.LoadAssetAsync<HotUpdateAssemblyManifest>("HotUpdateAssemblyManifest"))
|
|
|
+ .GetAssetObject<HotUpdateAssemblyManifest>();
|
|
|
+ var DLLNameList_ForABLoad = mainfest.AOTMetadataDlls;
|
|
|
|
|
|
List<UniTask<RawFileOperation>> tasks = new List<UniTask<RawFileOperation>>();
|
|
|
foreach (var aotDll in DLLNameList_ForABLoad)
|