[fix] 修复未对 MonoPInvokeCallback标注的函数签名做Optimized变换,导致与Runtime计算结果不一致的bug

main
walon 2022-10-18 09:21:51 +08:00
parent d8e155dc25
commit 82499dfe32
2 changed files with 2 additions and 1 deletions

View File

@ -82,6 +82,7 @@ namespace HybridCLR.Editor.ReversePInvokeWrap
ReturnInfo = new ReturnInfo { Type = typeCreator.CreateTypeInfo(method.Method.ReturnType)}, ReturnInfo = new ReturnInfo { Type = typeCreator.CreateTypeInfo(method.Method.ReturnType)},
ParamInfos = method.Method.Parameters.Select(p => new ParamInfo { Type = typeCreator.CreateTypeInfo(p.Type)}).ToList(), ParamInfos = method.Method.Parameters.Select(p => new ParamInfo { Type = typeCreator.CreateTypeInfo(p.Type)}).ToList(),
}; };
typeCreator.OptimizeMethod(desc);
desc.Init(); desc.Init();
if (!methodsBySig.TryGetValue(desc.Sig, out var arm)) if (!methodsBySig.TryGetValue(desc.Sig, out var arm))
{ {

View File

@ -1,6 +1,6 @@
{ {
"name": "com.focus-creative-games.hybridclr_unity", "name": "com.focus-creative-games.hybridclr_unity",
"version": "0.5.0", "version": "0.5.1",
"displayName": "HybridCLR", "displayName": "HybridCLR",
"description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR",
"category": "Runtime", "category": "Runtime",