using UnityEngine; using RR.Game2D.Core.Managers; namespace RR.Common.Settings { public static class SettingsApplier { public static void Apply(SettingEntry def, SettingValue v) { if (def == null) { Debug.LogWarning("[SettingsApplier] Cannot apply settings: SettingEntry is null"); return; } switch (def.applyTarget) { case ApplyTarget.None: return; case ApplyTarget.Audio: ApplyAudio(def, v); return; } } private static void ApplyAudio(SettingEntry def, SettingValue v) { float volume = Mathf.Clamp01(v.f); // Применяем через AudioManager if (GameManager.Instance?.Audio != null) { switch (def.audioTargetType) { case AudioTargetType.Music: GameManager.Instance.Audio.SetMusicVolume(volume); break; case AudioTargetType.Sfx: GameManager.Instance.Audio.SetSfxVolume(volume); break; } } } } }