我在 Android 上使用 LuaJava 的AndroLua端口,当我在文件 A 中定义全局表并尝试从文件 B 访问它时,缺少一些条目:
档案一:
Game = {
name = "name"
}
function Game:init()
self.score = 7
self.player = "othername"
require('B')
end
该Game:init()
方法是从 java 中调用的。
文件 B:
require('A')
print(Game.score) -- nil
print(Game.player) -- 'name'
为什么文件 B 不打印 '7' 和 'othername'?