LuaInterface.LuaDLL.lua_getmetatable C# (CSharp) Method

lua_getmetatable() private method

private lua_getmetatable ( IntPtr luaState, int objIndex ) : int
luaState System.IntPtr
objIndex int
return int
        public static extern int lua_getmetatable(IntPtr luaState, int objIndex);

Usage Example

示例#1
0
        //把一个table func 放在栈顶
        public bool RawGetField(string field)
        {
            IntPtr   L    = _Interpreter.L;
            LuaTypes type = LuaTypes.LUA_TNONE;

            LuaDLL.lua_getref(L, _Reference);
            LuaDLL.lua_pushstring(L, field);
            LuaDLL.lua_rawget(L, -2);

            if (LuaDLL.lua_isnil(L, -1))
            {
                LuaDLL.lua_pop(L, 1);

                if (LuaDLL.lua_getmetatable(L, -1) > 0)
                {
                    LuaDLL.lua_pushstring(L, field);
                    LuaDLL.lua_rawget(L, -2);
                }
            }

            type = LuaDLL.lua_type(L, -1);

            if (type == LuaTypes.LUA_TFUNCTION)
            {
                return(true);
            }

            return(false);
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_getmetatable
LuaDLL