xLua icon indicating copy to clipboard operation
xLua copied to clipboard

xlua在调用Lua脚本委托的时候显示没有实例

Open kyln7 opened this issue 2 years ago • 1 comments

在examples的luacallcsharp的脚本里案例是给了一个string参数的委托,我尝试自己写了一个string和一个int作为参数的委托:

//=========== in C# =========== [CSharpCallLua] public delegate void TestDelegate1(string param, int num); public TestDelegate1 testNewDelegate; public void csDelegate1(string param, int num) { Debug.Log("TestDelegate in c#:" + param + " , " + num); } --===========in lua =========== --Delegate testobj.testNewDelegate = testobj.csDelegate1 testobj.testNewDelegate('hello',0)

报错 LuaException: c# exception:c# exception:System.NullReferenceException: Object reference not set to an instance of an object

暂时不知道问题出在哪里,希望大佬能够解惑一二

kyln7 avatar Dec 10 '22 14:12 kyln7

emm,貌似是xLua还不支持获取成员函数地址?

kyln7 avatar Dec 10 '22 15:12 kyln7