Files
ichni_Official/Assets/Scripts/Settings/SettingsSaveData.cs
SoulliesOfficial 9fd5f098ab 设置扩展
2026-07-19 16:44:58 -04:00

130 lines
4.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using UnityEngine.Serialization;
namespace Ichni
{
/// <summary>
/// 与 Project Settings 中同名 Quality Level 对应的玩家图形档位。
/// 枚举值仅用于设置存档与 UI 顺序;实际应用时由 SettingsManager 按名称查找 Quality Level
/// 因此调整 Project Settings 的档位顺序不会错误切换到其他渲染 Asset。
/// </summary>
public enum GraphicsQualityPreset
{
Performant = 0,
Balanced = 1,
HighFidelity = 2
}
/// <summary>
/// PC 显示模式。移动端不使用此设置,相关 UI 也不会显示。
/// </summary>
public enum GraphicsDisplayMode
{
Fullscreen = 0,
BorderlessFullscreen = 1,
Windowed = 2
}
/// <summary>
/// Anime Bloom 的质量档位。
/// Off 会保持其他后处理可用,但不执行 BloomPerformance 与 Standard 分别使用预先确定的
/// Diffusion 值。具体数值由 <see cref="PostProcessingManager"/> 统一应用,避免散落在 UI 或谱面代码中。
/// </summary>
public enum BloomQuality
{
Off = 0,
Performance = 1,
Standard = 2
}
/// <summary>
/// Note 与其他演出特效将使用的全局质量档位。
/// 本阶段先完成存档、UI 与运行时读取入口;各特效物体后续按自身开销实现 Low / Medium / High 的实际降级策略。
/// </summary>
public enum VfxQuality
{
Low = 0,
Medium = 1,
High = 2
}
/// <summary>
/// 玩家设置的唯一持久化数据模型。
///
/// 此类只保存设置值,不负责将音量、图形或语言应用到运行时;
/// 运行时应用逻辑统一由 <see cref="SettingsManager"/> 处理。
/// 后续按 Audio、Gameplay、Graphics 等类别拆分字段时,必须保留
/// <see cref="schemaVersion"/>,并在 SettingsManager 中补充对应的迁移逻辑。
/// </summary>
[Serializable]
public class SettingsSaveData
{
/// <summary>
/// 设置存档结构版本。当前为首次建立 SettingsSaveData 的 V1。
/// </summary>
public const int CurrentSchemaVersion = 1;
public int schemaVersion = CurrentSchemaVersion;
// Audio
public int masterVolume = 50;
public int musicVolume = 50;
public int soundEffectVolume = 50;
public int uiVolume = 50;
/// <summary>
/// 是否启用游戏内音乐特效。当前控制 HighPassFilterEffect 与 LowPassFilterEffect
/// 关闭时会立即清除正在歌曲上的滤波 RTPC后续同类特效也应复用此开关。
/// </summary>
public bool enableInGameAudioEffects = true;
// Graphics
/// <summary>
/// 玩家选择的 Quality Preset。新存档会读取当前平台在 Project Settings 中配置的默认档位。
/// </summary>
public GraphicsQualityPreset graphicsQualityPreset = GraphicsQualityPreset.Balanced;
public int targetFrame = 60;
/// <summary>
/// URP Render Scale 档位05 分别对应 0.51.0。
/// 保留 FormerlySerializedAs 以兼容场景中旧的字段名;预发布 ES3 存档可直接重置。
/// </summary>
[FormerlySerializedAs("resolutionLevel")]
public int renderScaleLevel = 3;
/// <summary>
/// 后处理总开关。关闭后,所有 URP 相机都会停用 post-processingGlobal Volume 也不会参与计算;
/// 因此原生与自定义后处理都不会产生渲染开销。
/// </summary>
public bool enablePostProcessing = true;
/// <summary>
/// Anime Bloom 的质量档位。默认 Standard对应 Diffusion 8。
/// </summary>
public BloomQuality bloomQuality = BloomQuality.Standard;
/// <summary>
/// 后续 Note / 演出特效读取的质量档位。默认 High以保持当前未分级特效的视觉基线。
/// </summary>
public VfxQuality vfxQuality = VfxQuality.High;
// Desktop display settings. These values are saved on every platform but only applied on PC and in the Unity Editor.
public bool vSyncEnabled = false;
public GraphicsDisplayMode displayMode = GraphicsDisplayMode.BorderlessFullscreen;
public int displayResolutionWidth = 0;
public int displayResolutionHeight = 0;
// Gameplay
public int beatmapOffset = 0;
// Localization
public int languageIndex = 0;
// Developer settings. 这些字段会在后续分类重构时迁出正式 Release 设置。
public bool debugMode = false;
public bool judgeType = false;
public bool autoPlay = false;
}
}