|
|
@@ -289,46 +289,12 @@ public class GameMapEdPopup : PopupWindowContent
|
|
|
}
|
|
|
UnityEngine.Debug.Log($"\"{gameMap.showIdent}\"表保存完毕!");
|
|
|
UnityEngine.Debug.Log("记得运行\"gen_code_json.bat\"更新数据!");
|
|
|
- RunBat();
|
|
|
- }
|
|
|
-
|
|
|
- //运行.bat文件
|
|
|
- public static void RunBat()
|
|
|
- {
|
|
|
-
|
|
|
- string batPath = Application.dataPath + "/../Luban/gen_code_json.bat"; // 示例路径
|
|
|
-
|
|
|
- // 检查文件是否存在
|
|
|
- if (!System.IO.File.Exists(batPath))
|
|
|
- {
|
|
|
- UnityEngine.Debug.LogError(".bat文件不存在: " + batPath);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // 配置进程启动信息
|
|
|
- ProcessStartInfo psi = new ProcessStartInfo
|
|
|
- {
|
|
|
- FileName = "cmd.exe", // 通过cmd调用
|
|
|
- Arguments = $"/K \"{batPath}\"", // 传递.bat路径
|
|
|
- WorkingDirectory = System.IO.Path.GetDirectoryName(batPath),
|
|
|
- UseShellExecute = true,
|
|
|
- CreateNoWindow = false
|
|
|
- };
|
|
|
-
|
|
|
- // 启动进程
|
|
|
- try
|
|
|
- {
|
|
|
- Process.Start(psi);
|
|
|
- UnityEngine.Debug.Log("成功启动.bat文件: " + batPath);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- UnityEngine.Debug.LogError("启动失败: " + e.Message);
|
|
|
- }
|
|
|
+ ExcelEditor.RunBat();
|
|
|
}
|
|
|
|
|
|
public void ReloadExcelData(string path, int mapIdx)
|
|
|
{
|
|
|
+ ExcelEditor.RunBat();
|
|
|
List<string> excelWorksheets = new();
|
|
|
Tables allCfgData = new Tables(ExcelEditor.Loader);
|
|
|
List<SingleCreateEnemyConfig> cfgCreateEnemy = allCfgData.CfgCreateEnemy.DataList;
|