static void RunWithOption(Options options) { LuaEnv luaEnv = new LuaEnv(); LuaAPI.init_api(luaEnv); foreach (var luaFile in options.InputFiles) { byte[] chunk = File.ReadAllBytes(luaFile); object[] objs = luaEnv.DoString(chunk); foreach (LuaFunction func in objs) { if (func == null) { continue; } string luaFullPath = Path.GetFullPath(luaFile); var ctx = new ExportContext(luaEnv, Path.GetDirectoryName(luaFullPath)); func.Action(ctx); } } luaEnv.Dispose(); }