From 2902c554a614c76813dad0d03370e2c615f89e06 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Tue, 28 Jul 2026 01:11:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=AD=98=E6=A1=A3?= =?UTF-8?q?=E5=92=8C=E7=BB=93=E6=9E=9C=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/AssetRefs/ConstRef.cs | 9 ++++++--- Assets/Scripts/Game Loop/SettingLoader.cs | 11 ++++------- 2 files changed, 10 insertions(+), 10 deletions(-) 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()