lcy
1 天以前 b97ca7fc69d2cddeaf1af2d4e59ba4b413034784
Main/System/SystemSetting/SystemSetting.cs
@@ -3,7 +3,6 @@
using UnityEngine;
using UnityEngine.Events;
using System;
using vnxbqy.UI;
using System.Collections;
using Cysharp.Threading.Tasks;
@@ -12,8 +11,10 @@
{
    const string QUALITY_LEVEL_KEY = "GameQualityLevel";
    const string SOUND_VOLUME_KEY = "SoundRatioKey";  //音乐
    const string SOUND_EFFECT_KEY = "SoundEffect"; //音效
    const string SOUND_VOLUME_KEY = "MusicKey";  //音乐
    const string SOUND_EFFECT_KEY = "SoundEffectKey"; //音效
    const string MUTE_MUSIC_KEY = "MuteMusicKey"; //静音音乐
    const string MUTE_SOUND_EFFECT_KEY = "MuteSoundEffectKey"; //静音音效
    const string GAMEFRAME_KEY = "GameFrameSetting";//垂直同步率
    public Dictionary<SystemSwitch, bool> systemSettings = new Dictionary<SystemSwitch, bool>();
@@ -27,6 +28,7 @@
    public SystemSetting()
    {
        DTC0102_tagCDBPlayer.switchAccountEvent -= OnSwitchAccount;
        DTC0102_tagCDBPlayer.switchAccountEvent += OnSwitchAccount;
    }
@@ -43,7 +45,7 @@
    public float GetSoundVolume()
    {
        return LocalSave.GetFloat(SOUND_VOLUME_KEY, .55f);
        return LocalSave.GetFloat(SOUND_VOLUME_KEY, 0.3f);
    }
    public void SetSoundEffect(float value)
@@ -53,7 +55,29 @@
    public float GetSoundEffect()
    {
        return LocalSave.GetFloat(SOUND_EFFECT_KEY, .8f);
        return LocalSave.GetFloat(SOUND_EFFECT_KEY, 0.6f);
    }
    public void SetMuteMusic(bool _mute)
    {
        LocalSave.SetBool(MUTE_MUSIC_KEY, _mute);
        SoundPlayer.Instance.musicAudioSource.mute = _mute;
    }
    public bool GetMuteMusic()
    {
        return LocalSave.GetBool(MUTE_MUSIC_KEY, false);
    }
    public void SetMuteSoundEffect(bool _mute)
    {
        LocalSave.SetBool(MUTE_SOUND_EFFECT_KEY, _mute);
        SoundPlayer.Instance.MuteSoundEffect(_mute);
    }
    public bool GetMuteSoundEffect()
    {
        return LocalSave.GetBool(MUTE_SOUND_EFFECT_KEY, false);
    }
    public void SetGameFps(GameFps _frame)
@@ -163,18 +187,18 @@
                break;
        }
#if UNITY_ANDROID && !UNITY_EDITOR
        if (_disabeCamera)
        {
            CameraManager.uiCamera.enabled = false;
        }
// #if !UNITY_EDITOR
//         if (_disabeCamera)
//         {
//             CameraManager.uiCamera.enabled = false;
//         }
        ResolutionUtility.AdjustResolution(_quality);
        if (_disabeCamera)
        {
            Co_WaitFewMinute();
        }
#endif
//         ResolutionUtility.AdjustResolution(_quality);
//         if (_disabeCamera)
//         {
//             Co_WaitFewMinute();
//         }
// #endif
        if (qualityLevelChangeEvent != null)
        {
@@ -219,7 +243,7 @@
    public void LetFPSUnLimit()
    {
        Application.targetFrameRate = 1000;
        // Application.targetFrameRate = 1000;
    }
    private void OnSwitchAccount()