/// <summary> /// expects table on top /// </summary> public static void SetField(IntPtr L, LuaValue key, LuaValue value) { Check(L, -1); key.Push(L); value.Push(L); Lua.lua_settable(L, -3); }
/// <summary> /// expects table on top /// returns field from table on top of stack /// </summary> public static LuaValue GetField(IntPtr L, LuaValue key) { Check(L, -1); key.Push(L); Lua.lua_gettable(L, -2); var ret = Read(L, -2); Pop(L, 1); return(ret); }
public static void SetGlobal(IntPtr L, string name, LuaValue value) { value.Push(L); Lua.lua_setglobal(L, name); }
/// <summary> /// expects table on top /// returns field from table on top of stack /// </summary> public static LuaValue GetField(IntPtr L, LuaValue key) { Check(L, -1); key.Push(L); Lua.lua_gettable(L, -2); var ret = Read(L, -2); Pop(L, 1); return ret; }