Esempio n. 1
0
    public void SetField(SettingField field, UISettingItemFiller uiField)
    {
        int              paginationCount         = 0;
        int              selectedPaginationIndex = 0;
        string           selectedOption          = default;
        LocalizedString  fieldTitle = field.title;
        SettingFieldType fieldType  = field.settingFieldType;

        switch (field.settingFieldType)
        {
        case SettingFieldType.Language:
            paginationCount         = LocalizationSettings.AvailableLocales.Locales.Count;
            selectedPaginationIndex = LocalizationSettings.AvailableLocales.Locales.FindIndex(o => o == LocalizationSettings.SelectedLocale);
            selectedOption          = LocalizationSettings.SelectedLocale.LocaleName;
            break;

        case SettingFieldType.AntiAliasing:

            break;

        case SettingFieldType.FullScreen:
            selectedPaginationIndex = IsFullscreen();
            paginationCount         = 2;
            if (Screen.fullScreen)
            {
                selectedOption = "On";
            }
            else
            {
                selectedOption = "Off";
            }
            break;

        case SettingFieldType.GraphicQuality:
            selectedPaginationIndex = QualitySettings.GetQualityLevel();
            paginationCount         = 6;
            selectedOption          = QualitySettings.names[QualitySettings.GetQualityLevel()];
            break;

        case SettingFieldType.Resolution:

            break;

        case SettingFieldType.Shadow:

            break;

        case SettingFieldType.Volume_Music:
        case SettingFieldType.Volume_SFx:
            paginationCount         = 10;
            selectedPaginationIndex = 5;
            selectedOption          = "5";
            break;
        }
        uiField.FillSettingField(paginationCount, selectedPaginationIndex, selectedOption, fieldTitle, fieldType);
    }