diff --git a/Data~/Templates/ReversePInvokeMethodStub.cpp.txt b/Data~/Templates/ReversePInvokeMethodStub.cpp.txt index 1f298b9..736aebe 100644 --- a/Data~/Templates/ReversePInvokeMethodStub.cpp.txt +++ b/Data~/Templates/ReversePInvokeMethodStub.cpp.txt @@ -5,15 +5,16 @@ namespace hybridclr { namespace metadata { - //!!!{{REVERSE_PINVOKE_METHOD_STUB void CallLuaFunction(void* xState, int32_t wrapperIndex) { const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex(wrapperIndex); typedef void (*Callback)(void* xState, const MethodInfo* method); - ((Callback)GetInterpreterDirectlyCallMethodPointer(method))(xState, method); + ((Callback)(method->methodPointerCallByInterp))(xState, method); } + //!!!{{REVERSE_PINVOKE_METHOD_STUB + void __ReversePInvokeMethod_0(void* xState) { CallLuaFunction(xState, 0); diff --git a/Editor/ReversePInvokeWrap/Generator.cs b/Editor/ReversePInvokeWrap/Generator.cs index f765b9f..78de478 100644 --- a/Editor/ReversePInvokeWrap/Generator.cs +++ b/Editor/ReversePInvokeWrap/Generator.cs @@ -15,15 +15,6 @@ namespace HybridCLR.Editor.ReversePInvokeWrap var frr = new FileRegionReplace(template); var codes = new List(); - codes.Add(@" - void CallLuaFunction(void* xState, int32_t wrapperIndex) - { - const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex(wrapperIndex); - typedef void (*Callback)(void* xState, const MethodInfo* method); - ((Callback)GetInterpreterDirectlyCallMethodPointer(method))(xState, method); - } -"); - for(int i = 0; i < wrapperCount; i++) { codes.Add($@" diff --git a/package.json b/package.json index cadce58..3ca0f00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.focus-creative-games.hybridclr_unity", - "version": "0.4.1", + "version": "0.4.2", "displayName": "HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "category": "Runtime",