- 打印表
function PrintTable(table, key, level)
level = level or 1
local indent = ""
for i = 1, level do
indent = indent.." "
end
if key ~= nil then
print(indent..key.." ".."=".." ".."{")
else
print(indent .. "{")
end
for k,v in pairs(table) do
if type(v) == "table" then
PrintTable(v, key, level + 1)
else
local content = string.format("%s%s = %s", indent .. " ",tostring(k), tostring(v))
print(content)
end
end
print(indent .. "}")
end