|
|
@@ -72,7 +72,44 @@ namespace ET
|
|
|
{
|
|
|
public override byte[] Handle(ConfigComponent.GetOneConfigBytes args)
|
|
|
{
|
|
|
- throw new NotImplementedException("client cant use LoadOneConfig");
|
|
|
+ string ct = "cs";
|
|
|
+ GlobalConfig globalConfig = Resources.Load<GlobalConfig>("GlobalConfig");
|
|
|
+ CodeMode codeMode = globalConfig.CodeMode;
|
|
|
+ switch (codeMode)
|
|
|
+ {
|
|
|
+ case CodeMode.Client:
|
|
|
+ ct = "c";
|
|
|
+ break;
|
|
|
+ case CodeMode.Server:
|
|
|
+ ct = "s";
|
|
|
+ break;
|
|
|
+ case CodeMode.ClientServer:
|
|
|
+ ct = "cs";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new ArgumentOutOfRangeException();
|
|
|
+ }
|
|
|
+ List<string> startConfigs = new List<string>()
|
|
|
+ {
|
|
|
+ "StartMachineConfigCategory",
|
|
|
+ "StartProcessConfigCategory",
|
|
|
+ "StartSceneConfigCategory",
|
|
|
+ "StartZoneConfigCategory",
|
|
|
+ };
|
|
|
+
|
|
|
+ string configName = args.ConfigName;
|
|
|
+
|
|
|
+ string configFilePath;
|
|
|
+ if (startConfigs.Contains(configName))
|
|
|
+ {
|
|
|
+ configFilePath = $"../Config/Excel/{ct}/{Options.Instance.StartConfig}/{configName}.bytes";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ configFilePath = $"../Config/Excel/{ct}/{configName}.bytes";
|
|
|
+ }
|
|
|
+
|
|
|
+ return File.ReadAllBytes(configFilePath);
|
|
|
}
|
|
|
}
|
|
|
}
|