static int AddEvent(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); MyFrameWork.ThreadManager obj = (MyFrameWork.ThreadManager)ToLua.CheckObject(L, 1, typeof(MyFrameWork.ThreadManager)); ThreadEvent arg0 = (ThreadEvent)ToLua.CheckObject(L, 2, typeof(ThreadEvent)); System.Action <NotiData> arg1 = null; LuaTypes funcType3 = LuaDLL.lua_type(L, 3); if (funcType3 != LuaTypes.LUA_TFUNCTION) { arg1 = (System.Action <NotiData>)ToLua.CheckObject(L, 3, typeof(System.Action <NotiData>)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 3); arg1 = DelegateFactory.CreateDelegate(typeof(System.Action <NotiData>), func) as System.Action <NotiData>; } obj.AddEvent(arg0, arg1); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }