123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using Ragdoll;
- using Unity.VisualScripting;
- using UnityEngine;
- namespace UI.Hall
- {
- public class SettingManager : ScriptSingleton<SettingManager>
- {
- public static readonly int Sound = 1;
- public static readonly int Music = 2;
- public static readonly int Voice = 3;
- public Action<int,bool> 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;
- // }
- }
- }
- }
|