using System; using Ragdoll; using Unity.VisualScripting; using UnityEngine; namespace UI.Hall { public class SettingManager : ScriptSingleton { public static readonly int Sound = 1; public static readonly int Music = 2; public static readonly int Voice = 3; public Action SoundAction; private string KeyForSettingByFlag(int flag) { return "setting-" + flag; } public bool isSettingOpen(int flag) { return 1 == PlayerPrefs.GetInt(KeyForSettingByFlag(flag)); } public void changSetting(int flag, bool on) { if (on) { PlayerPrefs.SetInt(KeyForSettingByFlag(flag), 1); } else { PlayerPrefs.SetInt(KeyForSettingByFlag(flag), 0); } SoundAction?.Invoke(flag, on); // // switch (flag) // { // case 1: // SoundAction?.Invoke(on); // break; // case 2: // // break; // case 3: // // break; // } } } }