static int GetFieldsNum(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); TableUtil obj = (TableUtil)ToLua.CheckObject(L, 1, typeof(TableUtil)); int o = obj.GetFieldsNum(); LuaDLL.lua_pushinteger(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }