diff --git a/DungeonShooting_Godot/.gitignore b/DungeonShooting_Godot/.gitignore index 4a80ac8d..f884f1e8 100644 --- a/DungeonShooting_Godot/.gitignore +++ b/DungeonShooting_Godot/.gitignore @@ -12,3 +12,4 @@ /excelTool/.vscode /excelTool/publish /excelTool/Folder.DotSettings.user +/DungeonShooting.csproj.old* \ No newline at end of file diff --git a/DungeonShooting_Godot/DungeonShooting.csproj b/DungeonShooting_Godot/DungeonShooting.csproj index 6da3a836..7c9b4af6 100644 --- a/DungeonShooting_Godot/DungeonShooting.csproj +++ b/DungeonShooting_Godot/DungeonShooting.csproj @@ -1,4 +1,4 @@ - + net8.0 true diff --git a/DungeonShooting_Godot/excelTool/ExcelGenerator.cs b/DungeonShooting_Godot/excelTool/ExcelGenerator.cs index 6cee45fb..bc91590a 100644 --- a/DungeonShooting_Godot/excelTool/ExcelGenerator.cs +++ b/DungeonShooting_Godot/excelTool/ExcelGenerator.cs @@ -87,28 +87,31 @@ public static class ExcelGenerator if (directoryInfo.Exists) { var fileInfos = directoryInfo.GetFiles(); - //记录文件 + var tempFileInfos = new List(); + foreach (var fileInfo in fileInfos) { + //记录文件 if (fileInfo.Extension == ".xlsx") { var fileName = Path.GetFileNameWithoutExtension(fileInfo.Name).FirstToUpper(); + //判断是否是以字母开头 + if (!Regex.IsMatch(fileName, "^[a-zA-Z]")) + { + Console.WriteLine($"未被导出的表: {fileName}, excel表文件名称必须以字母开头!"); + continue; + } + + tempFileInfos.Add(fileInfo); _excelNames.Add(fileName); } } - + //读取配置文件 - foreach (var fileInfo in fileInfos) + foreach (var tempFileInfo in tempFileInfos) { - if (fileInfo.Extension == ".xlsx") - { - if (fileInfo.Name == "ExcelConfig.xlsx") - { - throw new Exception("excel表文件名称不允许叫'ExcelConfig.xlsx'!"); - } - Console.WriteLine("excel表: " + fileInfo.FullName); - excelDataList.Add(ReadExcel(fileInfo.FullName)); - } + Console.WriteLine("excel表: " + tempFileInfo.FullName); + excelDataList.Add(ReadExcel(tempFileInfo.FullName)); } } @@ -320,7 +323,7 @@ public static class ExcelGenerator outStr += $"using System.Collections.Generic;\n\n"; outStr += $"namespace Config;\n\n"; outStr += $"public static partial class ExcelConfig\n{{\n"; - outStr += $" public class {fileName}\n"; + outStr += $" public partial class {fileName}\n"; outStr += $" {{\n"; //继承的带有引用其他表的类代码 var outRefStr = ""; diff --git a/DungeonShooting_Godot/excelTool/serialize/ActivityType.cs b/DungeonShooting_Godot/excelTool/serialize/ActivityType.cs index acf51f00..e51990d6 100644 --- a/DungeonShooting_Godot/excelTool/serialize/ActivityType.cs +++ b/DungeonShooting_Godot/excelTool/serialize/ActivityType.cs @@ -1,5 +1,4 @@ - -/// +/// /// 物体类型 /// public enum ActivityType @@ -53,6 +52,10 @@ public enum ActivityType /// Npc, /// + /// Boss + /// + Boss, + /// /// 其它类型 /// Other = 99, diff --git a/DungeonShooting_Godot/excelTool/version b/DungeonShooting_Godot/excelTool/version index 301160a9..9d607966 100644 --- a/DungeonShooting_Godot/excelTool/version +++ b/DungeonShooting_Godot/excelTool/version @@ -1 +1 @@ -8 \ No newline at end of file +11 \ No newline at end of file