Skip to content

Commit 9d3f591

Browse files
committed
* fix gen code for asmdef feature
1 parent 84a4bca commit 9d3f591

File tree

11 files changed

+4
-0
lines changed

11 files changed

+4
-0
lines changed

Assets/XLua/Src/Editor/Hotfix.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ public class Hotfix
260260
{
261261
private TypeReference objType = null;
262262
private TypeReference delegateBridgeType = null;
263+
private TypeReference delegateBridgeWrapType = null;
263264
private AssemblyDefinition injectAssembly = null;
264265

265266
private MethodReference delegateBridgeGetter = null;
@@ -293,6 +294,7 @@ public void Init(AssemblyDefinition injectAssembly, AssemblyDefinition xluaAssem
293294
var delegateBridgeTypeDef = xluaAssembly.MainModule.Types.Single(t => t.FullName == "XLua.DelegateBridge");
294295
var delegateBridgeTypeWrapDef = genAssembly.MainModule.Types.SingleOrDefault(t => t.FullName == "XLua.DelegateBridge_Wrap");
295296
delegateBridgeType = injectModule.TryImport(delegateBridgeTypeDef);
297+
delegateBridgeWrapType = injectModule.TryImport(delegateBridgeTypeWrapDef);
296298
delegateBridgeGetter = injectModule.TryImport(xluaAssembly.MainModule.Types.Single(t => t.FullName == "XLua.HotfixDelegateBridge")
297299
.Methods.Single(m => m.Name == "Get"));
298300
hotfixFlagGetter = injectModule.TryImport(xluaAssembly.MainModule.Types.Single(t => t.FullName == "XLua.HotfixDelegateBridge")
@@ -1256,6 +1258,7 @@ bool injectMethod(MethodDefinition method, HotfixFlagInTool hotfixType)
12561258
{
12571259
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Ldc_I4, bridgeIndexByKey.Count));
12581260
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Call, delegateBridgeGetter));
1261+
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Castclass, delegateBridgeWrapType));
12591262
}
12601263
else
12611264
{
@@ -1398,6 +1401,7 @@ bool injectGenericMethod(MethodDefinition method, HotfixFlagInTool hotfixType)
13981401
processor.InsertBefore(insertPoint, jmpInstruction);
13991402
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Ldc_I4, bridgeIndexByKey.Count));
14001403
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Call, delegateBridgeGetter));
1404+
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Castclass, delegateBridgeWrapType));
14011405
processor.InsertBefore(insertPoint, processor.Create(OpCodes.Stloc, injection));
14021406
}
14031407
else

Tools/FilesSignature.exe

0 Bytes
Binary file not shown.

Tools/FilesSignature.pdb

-12.3 KB
Binary file not shown.

Tools/KeyPairsGen.exe

0 Bytes
Binary file not shown.

Tools/KeyPairsGen.pdb

-10.6 KB
Binary file not shown.

Tools/XLua.Mini.dll

-11.5 KB
Binary file not shown.

Tools/XLua.Mini.pdb

-290 KB
Binary file not shown.

Tools/XLuaGenerate.exe

3 KB
Binary file not shown.

Tools/XLuaGenerate.pdb

-89 KB
Binary file not shown.

Tools/XLuaHotfixInject.exe

-2 KB
Binary file not shown.

0 commit comments

Comments
 (0)