diff --git a/Assets/Scripts/AssetRefs/ConstRef.cs b/Assets/Scripts/AssetRefs/ConstRef.cs index c8597eac8..b3a306507 100644 --- a/Assets/Scripts/AssetRefs/ConstRef.cs +++ b/Assets/Scripts/AssetRefs/ConstRef.cs @@ -19,9 +19,9 @@ namespace AibisDream.Utility public const string WishlistURL = "https://store.steampowered.com/app/3473430/_All_Our_Broken_Parts?utm_source=playtest"; - public static readonly string SaveFilePath = Path.Combine(Application.persistentDataPath, "AllOurBrokenParts", "demo_saves"); + public static readonly string SaveFilePath = Path.Combine(Application.persistentDataPath, "demo_saves"); #if UNITY_EDITOR || DEVELOPMENT_BUILD - public static readonly string TestSavePath = Path.Combine(Application.persistentDataPath, "AllOurBrokenParts", "test_saves"); + public static readonly string TestSavePath = Path.Combine(Application.persistentDataPath, "test_saves"); #endif /// P2 槽位相关常量。 @@ -36,7 +36,10 @@ namespace AibisDream.Utility public const string SaveThumbnailFileName = "thumbnail"; public const string LatestSlotFileName = "latest_slot"; - public static readonly string ChapterProgressPath = Path.Combine(Application.persistentDataPath, "AllOurBrokenParts", "Config", "chapter.json"); + public static readonly string ChapterProgressPath = Path.Combine(Application.persistentDataPath, "config", "chapter.json"); + + public static readonly string SettingPath = Path.Combine(Application.persistentDataPath, "config", "setting.json"); + public static readonly string SettingDefaultPath = Path.Combine(Application.streamingAssetsPath, "Config", "setting.json"); public static readonly string CharacterConfigPath = Path.Combine(Application.streamingAssetsPath, "Config", "character.csv"); diff --git a/Assets/Scripts/Game Loop/SettingLoader.cs b/Assets/Scripts/Game Loop/SettingLoader.cs index 500646c60..dcbc9ce40 100644 --- a/Assets/Scripts/Game Loop/SettingLoader.cs +++ b/Assets/Scripts/Game Loop/SettingLoader.cs @@ -13,9 +13,6 @@ namespace AibisDream /// public class SettingLoader { - private static readonly string SettingPath = Path.Combine(Application.persistentDataPath, "AllOurBrokenParts", "Config", "setting.json"); - private static readonly string SettingDefaultPath = Path.Combine(Application.streamingAssetsPath, "Config", "setting.json"); - private readonly ConfigContainer _container; private SettingLoader() @@ -25,7 +22,7 @@ namespace AibisDream // 初始化设置文件(如果不存在) InitSettingFile(); // 读取数据 - _container = new ConfigContainer(SettingPath); + _container = new ConfigContainer(ConstRef.SettingPath); LoadAllSetting(); // 注册回调函数 _container.OnWrite += OnSettingChanged; @@ -39,14 +36,14 @@ namespace AibisDream private void InitSettingFile() { // 如果文件存在,则直接返回 - if (File.Exists(SettingPath)) + if (File.Exists(ConstRef.SettingPath)) { return; } // 如果文件不存在,则复制默认设置(Language 为空表示跟随系统语言) - var defaultSetting = JsonUtil.ReadJObject(SettingDefaultPath); - JsonUtil.SaveJObject(defaultSetting, SettingPath); + var defaultSetting = JsonUtil.ReadJObject(ConstRef.SettingDefaultPath); + JsonUtil.SaveJObject(defaultSetting, ConstRef.SettingPath); } private void LoadAllSetting()