Skip to content

Commit 488c9f3

Browse files
committed
[增加] HybridCLR的移除兼容
1 parent 24d2fba commit 488c9f3

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Assets/Scripts/Framework/Procedure/HotfixHelper.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
2-
using System.Linq;
32
using System.Reflection;
43
using GameFrameX.Runtime;
4+
#if ENABLE_GAME_FRAME_X_HYBRID_CLR
5+
using System.Linq;
56
using HybridCLR;
7+
#endif
68

79
namespace Unity.Startup.Procedure
810
{
@@ -27,8 +29,8 @@ public static async void StartHotfix()
2729
return;
2830
}
2931

32+
#if ENABLE_GAME_FRAME_X_HYBRID_CLR
3033
Log.Info("开始加载AOT DLL");
31-
3234
var aotDlls = AOTGenericReferences.PatchedAOTAssemblyList.ToArray();
3335
foreach (var aotDll in aotDlls)
3436
{
@@ -37,8 +39,8 @@ public static async void StartHotfix()
3739
var aotBytes = assetHandle.GetAssetObject<UnityEngine.TextAsset>().bytes;
3840
RuntimeApi.LoadMetadataForAOTAssembly(aotBytes, HomologousImageMode.SuperSet);
3941
}
40-
4142
Log.Info("结束加载AOT DLL");
43+
#endif
4244
Log.Info("开始加载Unity.Hotfix.dll");
4345
var assetHotfixDllPath = Utility.Asset.Path.GetCodePath(HotfixName + Utility.Const.FileNameSuffix.DLL);
4446
var assetHotfixDllOperationHandle = await GameApp.Asset.LoadAssetAsync<UnityEngine.Object>(assetHotfixDllPath);

Assets/Scripts/Unity.Startup.asmdef

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
"precompiledReferences": [],
3131
"autoReferenced": true,
3232
"defineConstraints": [],
33-
"versionDefines": [],
33+
"versionDefines": [
34+
{
35+
"name": "com.code-philosophy.hybridclr",
36+
"expression": "",
37+
"define": "ENABLE_GAME_FRAME_X_HYBRID_CLR"
38+
}
39+
],
3440
"noEngineReferences": false
3541
}

0 commit comments

Comments
 (0)