Esempio n. 1
0
        public void ReadSettingDataFromPlayerPrefs()
        {
            SettingDataToPlayerPrefs settingData = PlayerPrefsUtils.GetValueFromPlayerPrefs <SettingDataToPlayerPrefs>("SettingData" + GetPlayerId());

            musicChoose          = settingData.musicChoose == 0 ? 1 : settingData.musicChoose;
            soundChoose          = settingData.soundChoose == 0 ? 1 : settingData.soundChoose;
            damageNumChoose      = settingData.damageNumChoose == 0 ? 1 : settingData.damageNumChoose;
            displayBarChoose     = settingData.displayBarChoose == 0 ? 1 : settingData.displayBarChoose;
            languageIndex        = settingData.languageIndex == 0 ? 1 : settingData.languageIndex;
            camareViewChoose     = settingData.camareViewChoose == 0 ? 2 : settingData.camareViewChoose;
            qualitySettingChoose = settingData.qualitySettingChoose == 0 ? 2 : settingData.qualitySettingChoose;
            recordScreenChoose   = settingData.recordScreenChoose == 0 ? 1 : settingData.recordScreenChoose;
            unitOperationChoose  = settingData.unitOperationChoose == 0 ? 1 : settingData.unitOperationChoose;

            MessageDispatcher.PostMessage(MessageType.SoundVolume, soundChoose == 2 ? 0f : 1f);
            MessageDispatcher.PostMessage(MessageType.MusicVolume, musicChoose == 2 ? 0f : 1f);

            switch ((UI.QualitySettingType)qualitySettingChoose)
            {
            case UI.QualitySettingType.High:
                UnityEngine.QualitySettings.SetQualityLevel(GameConstants.QUALITY_HIGH_VALUE);
                break;

            case UI.QualitySettingType.Middle:
                UnityEngine.QualitySettings.SetQualityLevel(GameConstants.QUALITY_MIDDLE_VALUE);
                break;

            case UI.QualitySettingType.Low:
                UnityEngine.QualitySettings.SetQualityLevel(GameConstants.QUALITY_LOW_VALUE);
                break;
            }
        }