示例#1
0
        private static void ResetPrefs()
        {
            PlayerPrefs.DeleteKey(MasterAudio.StoredLanguageNameKey);

            MasterAudio.UseDbScaleForVolume = false;
            MasterAudio.UseCentsForPitch    = false;
            MasterAudio.HideLogoNav         = false;
            MasterAudioSettings.Instance.InstallationFolderPath   = MasterAudio.MasterAudioDefaultFolder;
            MasterAudioSettings.Instance.MixerWidthSetting        = MasterAudio.MixerWidthMode.Narrow;
            MasterAudioSettings.Instance.EditMAFolder             = false;
            MasterAudioSettings.Instance.BusesShownInNarrow       = true;
            MasterAudioSettings.Instance.ShowWelcomeWindowOnStart = true;

            EditorUtility.SetDirty(MasterAudioSettings.Instance);

            PlayerPrefs.DeleteKey(PersistentAudioSettings.SfxVolKey);
            PlayerPrefs.DeleteKey(PersistentAudioSettings.MusicVolKey);
            PlayerPrefs.DeleteKey(PersistentAudioSettings.SfxMuteKey);
            PlayerPrefs.DeleteKey(PersistentAudioSettings.MusicMuteKey);

            // delete group persistent settings
            var groups = PersistentAudioSettings.GroupsUpdatedKeys.Split(new[] { PersistentAudioSettings.Separator }, StringSplitOptions.RemoveEmptyEntries);

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var i = 0; i < groups.Length; i++)
            {
                var aGrp = groups[i];
                var key  = PersistentAudioSettings.GetGroupKey(aGrp);
                PlayerPrefs.DeleteKey(key);
            }

            PlayerPrefs.DeleteKey(PersistentAudioSettings.GroupKeysKey);

            // bus persistent settings
            var buses = PersistentAudioSettings.BusesUpdatedKeys.Split(new[] { PersistentAudioSettings.Separator }, StringSplitOptions.RemoveEmptyEntries);

            // ReSharper disable once ForCanBeConvertedToForeach
            for (var i = 0; i < buses.Length; i++)
            {
                var aBus = buses[i];
                var key  = PersistentAudioSettings.MakeBusKey(aBus);
                PlayerPrefs.DeleteKey(key);
            }

            PlayerPrefs.DeleteKey(PersistentAudioSettings.BusKeysKey);
        }
    private static void ResetPrefs()
    {
        PlayerPrefs.DeleteKey(MasterAudio.StoredLanguageNameKey);
        PlayerPrefs.DeleteKey(MasterAudio.UseDbKey);
        PlayerPrefs.DeleteKey(MasterAudio.UseCentsPitchKey);
        PlayerPrefs.DeleteKey(MasterAudio.HideLogoNavKey);
        PlayerPrefs.DeleteKey(MasterAudio.InstallationFolderKey);
        PlayerPrefs.DeleteKey(MasterAudio.MixerWidthSettingKey);

        PlayerPrefs.DeleteKey(PersistentAudioSettings.SfxVolKey);
        PlayerPrefs.DeleteKey(PersistentAudioSettings.MusicVolKey);
        PlayerPrefs.DeleteKey(PersistentAudioSettings.SfxMuteKey);
        PlayerPrefs.DeleteKey(PersistentAudioSettings.MusicMuteKey);

        MasterAudio._editMAFolder = false;

        // delete group persistent settings
        var groups = PersistentAudioSettings.GroupsUpdatedKeys.Split(new [] { PersistentAudioSettings.Separator }, StringSplitOptions.RemoveEmptyEntries);

        // ReSharper disable once ForCanBeConvertedToForeach
        for (var i = 0; i < groups.Length; i++)
        {
            var aGrp = groups[i];
            var key  = PersistentAudioSettings.GetGroupKey(aGrp);
            PlayerPrefs.DeleteKey(key);
        }

        PlayerPrefs.DeleteKey(PersistentAudioSettings.GroupKeysKey);

        // bus persistent settings
        var buses = PersistentAudioSettings.BusesUpdatedKeys.Split(new[] { PersistentAudioSettings.Separator }, StringSplitOptions.RemoveEmptyEntries);

        // ReSharper disable once ForCanBeConvertedToForeach
        for (var i = 0; i < buses.Length; i++)
        {
            var aBus = buses[i];
            var key  = PersistentAudioSettings.MakeBusKey(aBus);
            PlayerPrefs.DeleteKey(key);
        }

        PlayerPrefs.DeleteKey(PersistentAudioSettings.BusKeysKey);
    }