【发布时间】:2018-10-11 16:20:27
【问题描述】:
有人可以告诉我在 lua 中是否可以做这样的事情? 它在哪里使用模块文件来包含使用单个 lua 标头的其他模块文件?
--main.lua
require "std"
local test = WIDGETS[0]
--std.lua
require "std.constants" -- this is the problem its local to this file only
require "std.functions" -- this is the problem its local to this file only
-std.constants.lua
WIDGETS =
{
NONE,
PANEL,
BUTTON
}
我需要做这样的事情,所以我不必输入 std.constants.WIDGET[whatever]
【问题讨论】: