Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
- Добавил больше настроек в систему настроек - Пока у большинства настроек нет функционала - Немного изменил внешний вид настроек
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using UnityEngine;
|
|
using RR.Game2D.Core.Managers;
|
|
|
|
namespace RR.Common.Settings
|
|
{
|
|
public static class SettingsApplier
|
|
{
|
|
public static void Apply(SettingEntry def, SettingValue v)
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |