feat: 修改存档和结果路径

This commit is contained in:
2026-07-28 01:11:46 +08:00
parent 80e965b274
commit 2902c554a6
2 changed files with 10 additions and 10 deletions
+6 -3
View File
@@ -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
/// <summary>P2 槽位相关常量。</summary>
@@ -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");
+4 -7
View File
@@ -13,9 +13,6 @@ namespace AibisDream
/// </summary>
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()