多轮审查和修复
This commit is contained in:
@@ -7,7 +7,7 @@ namespace BaseGames.Core
|
||||
/// 全局设置管理器。从 GlobalSettingsSO 读取默认值,从文件加载用户覆盖。
|
||||
/// </summary>
|
||||
[DefaultExecutionOrder(-800)]
|
||||
public class SettingsManager : MonoBehaviour
|
||||
public class SettingsManager : MonoBehaviour, ISettingsService
|
||||
{
|
||||
private const string SettingsFileName = "settings.json";
|
||||
|
||||
@@ -18,6 +18,11 @@ namespace BaseGames.Core
|
||||
|
||||
public GlobalSettingsData Current => _current;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
ServiceLocator.Register<ISettingsService>(this);
|
||||
}
|
||||
|
||||
/// <summary>由 GameManager.Awake 调用。读取设置文件,应用音量/分辨率。</summary>
|
||||
public void Initialize()
|
||||
{
|
||||
@@ -61,7 +66,7 @@ namespace BaseGames.Core
|
||||
Screen.fullScreenMode = FullScreenMode.FullScreenWindow;
|
||||
}
|
||||
|
||||
// ── 音量设置(调用 AudioManager,Phase 1 接通)────────────────────
|
||||
// ── 音量设置(调用 AudioManager)────────────────────
|
||||
public void SetMasterVolume(float v) { _current.MasterVolume = v; Save(); }
|
||||
public void SetBGMVolume(float v) { _current.BGMVolume = v; Save(); }
|
||||
public void SetSFXVolume(float v) { _current.SFXVolume = v; Save(); }
|
||||
@@ -92,5 +97,10 @@ namespace BaseGames.Core
|
||||
_current.Language = localeCode;
|
||||
Save();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
ServiceLocator.Unregister<ISettingsService>(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user