private static int AttachResultListener(IntPtr L) { IntPtr ppMyClass = XLLRTWarper.luaL_checkudata(L, 1, "HelloBolt.MyClass"); IntPtr myclassIndex = new IntPtr(Marshal.ReadInt32(ppMyClass)); MyClass theObj = allLuaMyClassObj[myclassIndex.ToInt32()]; if (XLLRTWarper.lua_type(L, 2) == (int)LuaTypes.LUA_TFUNCTION) { int functionRef = XLLRTWarper.luaL_ref(L, (int)LuaInnerIndex.LUA_REGISTRYINDEX); LuaMyClassAddOb theOb = new LuaMyClassAddOb(L, functionRef); theObj.OnAddFinish += theOb.OnAddFinish; } return(0); }
private static int AttachResultListener(IntPtr L) { IntPtr ppMyClass = XLLRTWarper.luaL_checkudata(L, 1, "HelloBolt.MyClass"); IntPtr myclassIndex = new IntPtr(Marshal.ReadInt32(ppMyClass)); MyClass theObj = allLuaMyClassObj[myclassIndex.ToInt32()]; if(XLLRTWarper.lua_type(L,2) == (int)LuaTypes.LUA_TFUNCTION) { int functionRef = XLLRTWarper.luaL_ref(L, (int)LuaInnerIndex.LUA_REGISTRYINDEX); LuaMyClassAddOb theOb = new LuaMyClassAddOb(L,functionRef); theObj.OnAddFinish += theOb.OnAddFinish; } return 0; }