using System; using UnityEngine.Serialization; namespace Ichni { /// /// 与 Project Settings 中同名 Quality Level 对应的玩家图形档位。 /// 枚举值仅用于设置存档与 UI 顺序;实际应用时由 SettingsManager 按名称查找 Quality Level, /// 因此调整 Project Settings 的档位顺序不会错误切换到其他渲染 Asset。 /// public enum GraphicsQualityPreset { Performant = 0, Balanced = 1, HighFidelity = 2 } /// /// PC 显示模式。移动端不使用此设置,相关 UI 也不会显示。 /// public enum GraphicsDisplayMode { Fullscreen = 0, BorderlessFullscreen = 1, Windowed = 2 } /// /// Anime Bloom 的质量档位。 /// Off 会保持其他后处理可用,但不执行 Bloom;Performance 与 Standard 分别使用预先确定的 /// Diffusion 值。具体数值由 统一应用,避免散落在 UI 或谱面代码中。 /// public enum BloomQuality { Off = 0, Performance = 1, Standard = 2 } /// /// Note 与其他演出特效将使用的全局质量档位。 /// 本阶段先完成存档、UI 与运行时读取入口;各特效物体后续按自身开销实现 Low / Medium / High 的实际降级策略。 /// public enum VfxQuality { Low = 0, Medium = 1, High = 2 } /// /// 玩家设置的唯一持久化数据模型。 /// /// 此类只保存设置值,不负责将音量、图形或语言应用到运行时; /// 运行时应用逻辑统一由 处理。 /// 后续按 Audio、Gameplay、Graphics 等类别拆分字段时,必须保留 /// ,并在 SettingsManager 中补充对应的迁移逻辑。 /// [Serializable] public class SettingsSaveData { /// /// 设置存档结构版本。当前为首次建立 SettingsSaveData 的 V1。 /// 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; /// /// 是否启用游戏内音乐特效。当前控制 HighPassFilterEffect 与 LowPassFilterEffect; /// 关闭时会立即清除正在歌曲上的滤波 RTPC,后续同类特效也应复用此开关。 /// public bool enableInGameAudioEffects = true; // Graphics /// /// 玩家选择的 Quality Preset。新存档会读取当前平台在 Project Settings 中配置的默认档位。 /// public GraphicsQualityPreset graphicsQualityPreset = GraphicsQualityPreset.Balanced; public int targetFrame = 60; /// /// URP Render Scale 档位,0–5 分别对应 0.5–1.0。 /// 保留 FormerlySerializedAs 以兼容场景中旧的字段名;预发布 ES3 存档可直接重置。 /// [FormerlySerializedAs("resolutionLevel")] public int renderScaleLevel = 3; /// /// 后处理总开关。关闭后,所有 URP 相机都会停用 post-processing,Global Volume 也不会参与计算; /// 因此原生与自定义后处理都不会产生渲染开销。 /// public bool enablePostProcessing = true; /// /// Anime Bloom 的质量档位。默认 Standard,对应 Diffusion 6。 /// public BloomQuality bloomQuality = BloomQuality.Standard; /// /// 后续 Note / 演出特效读取的质量档位。默认 High,以保持当前未分级特效的视觉基线。 /// 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; } }