31 lines
1.0 KiB
C#
31 lines
1.0 KiB
C#
using SGModule.Common.Helper;
|
|
using UnityEngine;
|
|
|
|
namespace SGModule.Common {
|
|
public static class ConfigManager {
|
|
private const string GameConfigFilePath = "GameConfig";
|
|
private const string NetworkConfigFilePath = "NetworkConfig";
|
|
|
|
static ConfigManager() {
|
|
GameConfig = Resources.Load<GameConfig>(GameConfigFilePath);
|
|
if (GameConfig == null) {
|
|
Log.Common.Error($"加载失败:未找到配置文件 {GameConfigFilePath},请确保它放在 Resources 文件夹下并命名正确");
|
|
}
|
|
|
|
NetworkConfig = Resources.Load<NetworkConfig>(NetworkConfigFilePath);
|
|
if (NetworkConfig == null) {
|
|
Log.Common.Error($"加载失败:未找到配置文件 {NetworkConfigFilePath},请确保它放在 Resources 文件夹下并命名正确");
|
|
}
|
|
}
|
|
|
|
|
|
public static GameConfig GameConfig {
|
|
get;
|
|
}
|
|
|
|
public static NetworkConfig NetworkConfig {
|
|
get;
|
|
}
|
|
}
|
|
}
|