Exemple #1
0
        private void LoadGeneralSettings()
        {
            currentGeneralSettings = GetDefaultGeneralSettings();

            if (PlayerPrefsUtils.HasKey(GENERAL_SETTINGS_KEY))
            {
                try
                {
                    object currentSetting = currentGeneralSettings;
                    JsonUtility.FromJsonOverwrite(PlayerPrefsUtils.GetString(GENERAL_SETTINGS_KEY), currentSetting);
                    currentGeneralSettings = (SettingsData.GeneralSettings)currentSetting;
                }
                catch (Exception e)
                {
                    Debug.Log(e.Message);
                }
            }
        }
        private void LoadQualitySettings()
        {
            bool isQualitySettingsSet = false;

            if (PlayerPrefsUtils.HasKey(QUALITY_SETTINGS_KEY))
            {
                try
                {
                    currentQualitySettings = JsonUtility.FromJson <SettingsData.QualitySettings>(PlayerPrefsUtils.GetString(QUALITY_SETTINGS_KEY));
                    isQualitySettingsSet   = true;
                }
                catch (Exception e)
                {
                    Debug.Log(e.Message);
                }
            }
            if (!isQualitySettingsSet)
            {
                currentQualitySettings = qualitySettingsPreset.defaultPreset;
            }
        }
Exemple #3
0
    public void CheckLanguage()
    {
        if (PlayerPrefsUtils.HasKey(LocalDataName.CURRENTLANGUAGETYPEKEY) == true)
        {
            m_currentLanguageType = (LanguageType)PlayerPrefsUtils.GetInt(LocalDataName.CURRENTLANGUAGETYPEKEY);
            Debug.Log("CheckLanguage ---->_type=" + m_currentLanguageType);
            return;
        }

        LanguageType _type = LanguageType.English;

        switch (Application.systemLanguage)
        {
        case SystemLanguage.English:
            _type = LanguageType.English;
            break;

        case SystemLanguage.Spanish:
            _type = LanguageType.Spanish;
            break;

        case SystemLanguage.Japanese:
            _type = LanguageType.Japanese;
            break;

        case SystemLanguage.French:
            _type = LanguageType.French;
            break;

        case SystemLanguage.German:
            _type = LanguageType.German;
            break;

        case SystemLanguage.Italian:
            _type = LanguageType.Italian;
            break;

        case SystemLanguage.Dutch:
            _type = LanguageType.Dutch;
            break;

        case SystemLanguage.Russian:
            _type = LanguageType.Russian;
            break;

        case SystemLanguage.Arabic:
            _type = LanguageType.Arabic;
            break;

        case SystemLanguage.Korean:
            _type = LanguageType.Korean;
            break;

        case SystemLanguage.Chinese:
        case SystemLanguage.ChineseSimplified:
            _type = LanguageType.ChineseSimplified;
            break;

        case SystemLanguage.ChineseTraditional:
            _type = LanguageType.ChineseTraditional;
            break;

        default:
            _type = LanguageType.English;
            break;
        }
        GameApp.Event.DispatchNow((int)LocalMessageName.CC_REFRESH_LANGUAGE, _type);
        Debug.Log("CheckLanguage---->_type =" + _type + " ,system = " + Application.systemLanguage);
    }