GeWuYou a45bf27c8b refactor(setting): 重构设置重置功能实现
- 移除 SettingsResetEvent 中的旧设置属性,改为仅保存新设置
- 删除 SettingsPersistence 中的重置方法,统一通过命令模式处理
- 在 SettingsSystem 中添加 ResetAsync 方法并集成命令模式
- 为 AudioSettings 和 GraphicsSettings 添加 Reset 方法实现
- 扩展 ISettingsData 接口添加 Reset 方法定义
- 从接口中移除重置相关方法定义
- 在 ISettingsSystem 中添加重置相关的异步方法声明
- 为 AudioBusMapSettings 添加 Reset 方法实现
- 新增 ResetSettingsCommand 和 ResetSettingsInput 实现命令模式
- 添加 SettingsData 抽象基类提供默认的 Reset 实现
- [skip ci]
2026-01-17 16:07:37 +08:00

32 lines
841 B
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.

namespace GFramework.Game.Abstractions.setting;
/// <summary>
/// 音频设置类,用于管理游戏中的音频配置
/// </summary>
public class AudioSettings : ISettingsData
{
/// <summary>
/// 获取或设置主音量,控制所有音频的总体音量
/// </summary>
public float MasterVolume { get; set; } = 1.0f;
/// <summary>
/// 获取或设置背景音乐音量控制BGM的播放音量
/// </summary>
public float BgmVolume { get; set; } = 0.8f;
/// <summary>
/// 获取或设置音效音量控制SFX的播放音量
/// </summary>
public float SfxVolume { get; set; } = 0.8f;
/// <summary>
/// 重置音频设置为默认值
/// </summary>
public void Reset()
{
MasterVolume = 1.0f;
BgmVolume = 0.8f;
SfxVolume = 0.8f;
}
}