Browse Source

【优化】优化配置生成路径

johnclot69 11 months ago
parent
commit
24bf905d80

+ 5 - 6
Share/Tool/ExcelExporter/ExcelExporter.cs

@@ -58,8 +58,7 @@ namespace ET
         // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
         private const string ServerClassDir = "../DotNet/Model/Generate/Config";
 
-        private const string CSClassDir = "../Unity/Assets/Scripts/Codes/Model/Client/Generate/Config";
-        // private const string CSClassDir = "../Unity/Assets/Scripts/Codes/Model/Generate/ClientServer/Config";
+        private const string CSClassDir = "../Unity/Assets/Scripts/Codes/Model/Generate/ClientServer/Config";
 
         private const string excelDir = "../Config/Excel/";
 
@@ -172,13 +171,13 @@ namespace ET
                     {
                         ExportClass(kv.Key, kv.Value.HeadInfos, ConfigType.s);
                     }
-                    ExportClass(kv.Key, kv.Value.HeadInfos, ConfigType.cs);
+                    // ExportClass(kv.Key, kv.Value.HeadInfos, ConfigType.cs);
                 }
 
                 // 动态编译生成的配置代码
                 configAssemblies[(int) ConfigType.c] = DynamicBuild(ConfigType.c);
                 configAssemblies[(int) ConfigType.s] = DynamicBuild(ConfigType.s);
-                configAssemblies[(int) ConfigType.cs] = DynamicBuild(ConfigType.cs);
+                // configAssemblies[(int) ConfigType.cs] = DynamicBuild(ConfigType.cs);
 
                 List<string> excels = FileHelper.GetAllFiles(excelDir, "*.xlsx");
                 
@@ -257,8 +256,8 @@ namespace ET
                 ExportExcelJson(p, fileNameWithoutCS, table, ConfigType.s, relativePath);
                 ExportExcelProtobuf(ConfigType.s, protoName, relativePath);
             }
-            ExportExcelJson(p, fileNameWithoutCS, table, ConfigType.cs, relativePath);
-            ExportExcelProtobuf(ConfigType.cs, protoName, relativePath);
+            // ExportExcelJson(p, fileNameWithoutCS, table, ConfigType.cs, relativePath);
+            // ExportExcelProtobuf(ConfigType.cs, protoName, relativePath);
         }
 
         private static string GetProtoDir(ConfigType configType, string relativeDir)

+ 1 - 9
Share/Tool/Proto2CS/Proto2CS.cs

@@ -26,8 +26,7 @@ namespace ET
         private const string protoDir = "../Config/Proto";
         private const string clientMessagePath = "../Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/";
         private const string serverMessagePath = "../DotNet/Model/Generate/Message/";
-        private const string clientServerMessagePath = "../Unity/Assets/Scripts/Codes/Model/Client/Generate/Message";
-        // private const string clientServerMessagePath = "../Unity/Assets/Scripts/Codes/Model/Generate/ClientServer/Message/";
+        
         private static readonly char[] splitChars = { ' ', '\t' };
         private static readonly List<OpcodeInfo> msgOpcode = new List<OpcodeInfo>();
 
@@ -44,11 +43,6 @@ namespace ET
             {
                 Directory.Delete(serverMessagePath, true);
             }
-            
-            if (Directory.Exists(clientServerMessagePath))
-            {
-                Directory.Delete(clientServerMessagePath, true);
-            }
 
             List<string> list = FileHelper.GetAllFiles(protoDir, "*proto");
             foreach (string s in list)
@@ -192,13 +186,11 @@ namespace ET
             {
                 GenerateCS(sb, clientMessagePath, proto);
                 GenerateCS(sb, serverMessagePath, proto);
-                GenerateCS(sb, clientServerMessagePath, proto);
             }
             
             if (cs.Contains("S"))
             {
                 GenerateCS(sb, serverMessagePath, proto);
-                GenerateCS(sb, clientServerMessagePath, proto);
             }
         }
 

+ 0 - 3
Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/UnitConfig.cs

@@ -86,9 +86,6 @@ namespace ET
 		/// <summary>身高</summary>
 		[ProtoMember(5)]
 		public int Height { get; set; }
-		/// <summary>体重</summary>
-		[ProtoMember(6)]
-		public int Weight { get; set; }
 
 	}
 }