今天写了一段lua代码,在win32中正常运行,在android中运行无效。
大概是这样的:
------file1.lua-----
local t = {}
t.str = "this is file1.t"
return t
----------------------
-----file2.lua------
local t = require "file1"
print(t.str)
----------------------
所以没办法,只好这样修改:
------file1.lua-----
local t = {}
t.str = "this is file1.t"
_G.t = t
----------------------
-----file2.lua------
require "file1"
print(t.str)
----------------------
就都能运行了。