|
@@ -170,6 +170,11 @@ return aaa";
|
|
|
{
|
|
{
|
|
|
B2T("D:/项目/其他/Language15000-19000.csv", "D:/项目/其他/111.csv",Encoding.UTF8);
|
|
B2T("D:/项目/其他/Language15000-19000.csv", "D:/项目/其他/111.csv",Encoding.UTF8);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (GUILayout.Button("复制luacfg文件"))
|
|
|
|
|
+ {
|
|
|
|
|
+ CopyFleByLuaCfg("Assets\\Editor\\CsvToLua\\LuaCfg.lua","", "D:/项目/图/仙境/cn/","_cn");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static string GetFilePath()
|
|
public static string GetFilePath()
|
|
@@ -708,7 +713,7 @@ return aaa";
|
|
|
|
|
|
|
|
string field = fieldValue.RawGet<string, string>("field");
|
|
string field = fieldValue.RawGet<string, string>("field");
|
|
|
string value = fieldValue.RawGet<string, string>("value");
|
|
string value = fieldValue.RawGet<string, string>("value");
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
SetLuaLine(rowDatas,id,field,value.ToString(),"{0},");
|
|
SetLuaLine(rowDatas,id,field,value.ToString(),"{0},");
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -720,6 +725,40 @@ return aaa";
|
|
|
File.WriteAllLines(outputPath, rowDatas);
|
|
File.WriteAllLines(outputPath, rowDatas);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private static void CopyFleByLuaCfg(string luacfgpath, string fileRootPath,string outputPath,string output)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ using (LuaState runTime = new LuaState())
|
|
|
|
|
+ {
|
|
|
|
|
+ runTime.Start();
|
|
|
|
|
+ LuaTable luaTable = runTime.DoFile<LuaTable>(luacfgpath);
|
|
|
|
|
+
|
|
|
|
|
+ LuaFunction init_fun = luaTable.GetLuaFunction("Init");
|
|
|
|
|
+ LuaFunction SetOutput_fun = luaTable.GetLuaFunction("SetOutput");
|
|
|
|
|
+ LuaFunction GetNextCfg_fun = luaTable.GetLuaFunction("GetNextCfg");
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ init_fun.Call<LuaTable>(luaTable);
|
|
|
|
|
+ SetOutput_fun.Call<LuaTable, string>(luaTable, output);
|
|
|
|
|
+
|
|
|
|
|
+ while (true)
|
|
|
|
|
+ {
|
|
|
|
|
+ LuaTable cfg = GetNextCfg_fun.Invoke<LuaTable>();
|
|
|
|
|
+ //{result = false,path = path,outputPath = outputPath}
|
|
|
|
|
+ bool result = cfg.RawGet<string, bool>("result");
|
|
|
|
|
+ if (result)
|
|
|
|
|
+ {
|
|
|
|
|
+ string path = cfg.RawGet<string, string>("path");
|
|
|
|
|
+ string _outputPath = cfg.RawGet<string, string>("outputPath");
|
|
|
|
|
+ File.Copy(fileRootPath+path,outputPath+_outputPath,true);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
struct lgInfo
|
|
struct lgInfo
|
|
|
{
|
|
{
|
|
|
public int index;
|
|
public int index;
|