摘要: lua 中只有 false 和 nil 表示假,其他都是表示真。 数字0和空字符串也表示真。 代码: local cymometerSwitch = 0 if cymometerSwitch then print(111111) else print(222222) end 打印111111 阅读全文
posted @ 2024-05-31 16:18 朱小勇 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1.代码 local publicParasKey = {"a", "b"} local publicParas = {} local function initPublicParas() for _, name in ipairs(publicParasKey) do print("name", 阅读全文
posted @ 2024-05-31 14:59 朱小勇 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1111 阅读全文
posted @ 2024-05-31 14:05 朱小勇 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1.代码 local status, calParaFun = pcall(require, calParaFileName) if not status then -- 如果模块加载失败则创建脚本文件 local file = io.open(calParaFileName..".lua", "w 阅读全文
posted @ 2024-05-31 11:34 朱小勇 阅读(5) 评论(0) 推荐(0) 编辑