internal static bool SetMetaTable(IntPtr L, int table_index) { LuaAPI.xlua_getglobal(L, DefineConstantsCookieHandler.COOKIE_VAR); if (LuaAPI.lua_getmetatable(L, -1) == 0) { LuaAPI.lua_pop(L, 1); Debug.Log("Need Table to SetMetatable!"); return(false); } LuaAPI.lua_setmetatable(L, table_index); LuaAPI.lua_pop(L, 1); return(true); }