private lua_gettable ( |
||
luaState | ||
index | int | |
Résultat | void |
public static extern void lua_gettable(IntPtr luaState, int index);
[DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]
public LuaFunction RawGetFunc(string field) { IntPtr L = _Interpreter.L; LuaTypes type = LuaTypes.LUA_TNONE; LuaFunction func = null; int oldTop = LuaDLL.lua_gettop(L); LuaDLL.lua_getref(L, _Reference); LuaDLL.lua_pushstring(L, field); LuaDLL.lua_gettable(L, -2); type = LuaDLL.lua_type(L, -1); if (type == LuaTypes.LUA_TFUNCTION) { func = new LuaFunction(LuaDLL.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX), L); } LuaDLL.lua_settop(L, oldTop); return(func); }