From fdb9cc034a952a7ba478a7fe3e5f7715073e6dcb Mon Sep 17 00:00:00 2001 From: walon Date: Sun, 6 Nov 2022 20:16:38 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=AA=E7=94=9F=E6=95=88=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Installer/UpdateController.cs | 4 ++-- Runtime/RuntimeApi.cs | 24 +++++++++++++++++++++--- package.json | 2 +- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/Editor/Installer/UpdateController.cs b/Editor/Installer/UpdateController.cs index 8fe5549..c1e133c 100644 --- a/Editor/Installer/UpdateController.cs +++ b/Editor/Installer/UpdateController.cs @@ -11,7 +11,7 @@ var ret1 = BashUtil.RunCommand2(hybridclrRepoDir, "git", new string[] { "log", "HEAD", "-n", "1", "--pretty=format:\"%H\"", }); BashUtil.RunCommand2(hybridclrRepoDir, "git", - new string[] { "fetch", "depth=1" }); + new string[] { "fetch", "--depth=1" }); var ret2 = BashUtil.RunCommand2(hybridclrRepoDir, "git", new string[] { "log", "remotes/origin/HEAD", "-n", "1", "--pretty=format:\"%H\"", }); if (ret1.StdOut != ret2.StdOut) @@ -25,7 +25,7 @@ var ret1 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git", new string[] { "log", $"{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", }); BashUtil.RunCommand2(il2cppPlusRepoDir, "git", - new string[] { "fetch", "depth=1" }); + new string[] { "fetch", "--depth=1" }); var ret2 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git", new string[] { "log", $"remotes/origin/{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", }); if (ret1.StdOut != ret2.StdOut) diff --git a/Runtime/RuntimeApi.cs b/Runtime/RuntimeApi.cs index 3019212..c87af14 100644 --- a/Runtime/RuntimeApi.cs +++ b/Runtime/RuntimeApi.cs @@ -56,10 +56,28 @@ namespace HybridCLR // } //} + /// + /// 指示混合执行assembly使用原始的AOT代码。当assembly没有发生变化时必须调用此接口。 + /// + /// + /// +#if UNITY_EDITOR + public static LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName) + { + return LoadImageErrorCode.OK; + } +#else [DllImport(dllName, EntryPoint = "RuntimeApi_UseDifferentialHybridAOTAssembly")] public static extern LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName); +#endif + /// + /// 加载差分混合执行 assembly + /// + /// + /// + /// public static unsafe LoadImageErrorCode LoadDifferentialHybridAssembly(byte[] dllBytes, byte[] optionBytes) { #if UNITY_EDITOR @@ -67,16 +85,16 @@ namespace HybridCLR #else fixed(byte* dllBytesPtr = dllBytes) { - fixed(byte* tokenPtr = optionBytes) + fixed(byte* optionBytesPtr = optionBytes) { - return (LoadImageErrorCode)LoadDifferentialHybridAssembly(dllBytesPtr, dllBytes.Length, tokenPtr, optionBytes.Length); + return (LoadImageErrorCode)LoadDifferentialHybridAssembly(dllBytesPtr, dllBytes.Length, optionBytesPtr, optionBytes.Length); } } #endif } [DllImport(dllName, EntryPoint = "RuntimeApi_LoadDifferentialHybridAssembly")] - public static extern unsafe int LoadDifferentialHybridAssembly(byte* dllBytes, int dllSize, byte* notChangeMethodTokens, int tokenCount); + public static extern unsafe int LoadDifferentialHybridAssembly(byte* dllBytes, int dllSize, byte* optionBytesPtr, int optionBytesLength); /// /// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小) diff --git a/package.json b/package.json index 3bfd478..d00df7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.focus-creative-games.hybridclr_unity", - "version": "0.10.0", + "version": "0.10.1", "displayName": "HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "category": "Runtime",