LuaInterface.LuaDLL.lua_gettable C# (CSharp) Method

lua_gettable() private method

private lua_gettable ( IntPtr luaState, int index ) : void
luaState System.IntPtr
index int
return void
        public static extern void lua_gettable(IntPtr luaState, int index);
        [DllImport(LUADLL, CallingConvention = CallingConvention.Cdecl)]

Usage Example

示例#1
0
        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);
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_gettable
LuaDLL