导表前应该是要把旧的配置删掉的吧?如果从 CodeMode.ClientServer 切到 CodeMode.Client,那之前复制的服务端的配置依然存在了。
看日志 Directory.Delete(“Assets/Bundles/Config”, true); 这一行之前是加了的,后来被屏蔽了,这是为何呢?
现在的代码是这样:
if (GUILayout.Button("ExcelExporter"))
{
// Directory.Delete("Assets/Bundles/Config", true);
ToolsEditor.ExcelExporter();
// 如果是ClientServer,那么客户端要使用服务端配置
if (this.globalConfig.CodeMode == CodeMode.ClientServer)
{
FileHelper.CopyDirectory("../Config/StartConfig/Localhost", "Assets/Bundles/Config/StartConfig/Localhost");
foreach (string file in Directory.GetFiles("../Config/", "*.bytes"))
{
File.Copy(file, $"Assets/Bundles/Config/{Path.GetFileName(file)}", true);
}
}
Debug.Log("copy config to Assets/Bundles/Config");
}