diff --git a/Editor/Installer/InstallerController.cs b/Editor/Installer/InstallerController.cs index 84d641e..84c895e 100644 --- a/Editor/Installer/InstallerController.cs +++ b/Editor/Installer/InstallerController.cs @@ -68,10 +68,6 @@ namespace HybridCLR.Editor.Installer public string Il2CppBranch => GetIl2CppPlusBranchByUnityVersion(Application.unityVersion); - public string InitLocalIl2CppBatFile => Application.dataPath + "/../HybridCLRData/init_local_il2cpp_data.bat"; - - public string InitLocalIl2CppBashFile => Application.dataPath + "/../HybridCLRData/init_local_il2cpp_data.sh"; - public InstallerController() { PrepareIl2CppInstallPath(); diff --git a/Runtime/HomologousImageMode.cs b/Runtime/HomologousImageMode.cs new file mode 100644 index 0000000..dd839ca --- /dev/null +++ b/Runtime/HomologousImageMode.cs @@ -0,0 +1,10 @@ + +namespace HybridCLR +{ + public enum HomologousImageMode + { + Consistent, // AOT dll需要跟主工程精确一致,即为裁剪后的AO dll + SuperSet, // AOT dll不需要跟主工程精确一致,但必须包含裁剪后的AOT dll的所有元数据,即为裁剪后dll的超集。推荐使用原始aot dll + } +} + diff --git a/Runtime/HomologousImageMode.cs.meta b/Runtime/HomologousImageMode.cs.meta new file mode 100644 index 0000000..dde78bf --- /dev/null +++ b/Runtime/HomologousImageMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f0351553ad90e74aa586746b5965ded +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/LoadImageErrorCode.cs b/Runtime/LoadImageErrorCode.cs index 24e0ee6..195122a 100644 --- a/Runtime/LoadImageErrorCode.cs +++ b/Runtime/LoadImageErrorCode.cs @@ -1,7 +1,7 @@  namespace HybridCLR { - public enum LoadImageErrorCode + public enum LoadImageErrorCode { OK = 0, BAD_IMAGE, // dll 不合法 @@ -9,6 +9,7 @@ namespace HybridCLR AOT_ASSEMBLY_NOT_FIND, // 对应的AOT assembly未找到 HOMOLOGOUS_ONLY_SUPPORT_AOT_ASSEMBLY, // 不能给解释器assembly补充元数据 HOMOLOGOUS_ASSEMBLY_HAS_LOADED, // 已经补充过了,不能再次补充 + INVALID_HOMOLOGOUS_MODE, // 非法HomologousImageMode }; } diff --git a/Runtime/RuntimeApi.cs b/Runtime/RuntimeApi.cs index 2c0bc0b..e8fb681 100644 --- a/Runtime/RuntimeApi.cs +++ b/Runtime/RuntimeApi.cs @@ -24,14 +24,14 @@ namespace HybridCLR /// /// /// - public static unsafe LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllBytes) + public static unsafe LoadImageErrorCode LoadMetadataForAOTAssembly(byte[] dllBytes, HomologousImageMode mode) { #if UNITY_EDITOR return LoadImageErrorCode.OK; #else fixed(byte* data = dllBytes) { - return (LoadImageErrorCode)LoadMetadataForAOTAssembly((IntPtr)data, dllBytes.Length); + return (LoadImageErrorCode)LoadMetadataForAOTAssembly((IntPtr)data, dllBytes.Length, (int)mode); } #endif } @@ -43,7 +43,7 @@ namespace HybridCLR /// /// [DllImport(dllName, EntryPoint = "RuntimeApi_LoadMetadataForAOTAssembly")] - public static extern int LoadMetadataForAOTAssembly(IntPtr dllBytes, int dllSize); + public static extern int LoadMetadataForAOTAssembly(IntPtr dllBytes, int dllSize, int mode); /// /// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小) diff --git a/package.json b/package.json index 256817b..4d1a0b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.focus-creative-games.hybridclr_unity", - "version": "0.8.0", + "version": "0.9.0", "displayName": "HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "category": "Runtime",