Exemple #1
0
        // Start is called before the first frame update
        protected void Start()
        {
            settings = GetComponent <SystemSettings>();

            if (settings && SaveSystemXml.CheckFileExsits())
            {
                SystemSettingsData settingsData = SaveSystemXml.LoadSettings();
                settings.fullscreen     = settingsData.Fullscreen;
                settings.resolution     = settingsData.Resolution;
                settings.vsyncCount     = settingsData.VsyncCount;
                settings.graphicsPreset = settingsData.GraphicsPreset;
                settings.masterVolume   = settingsData.MasterVolume;
                settings.effectsVolume  = settingsData.EffectsVolume;
            }
            else
            {
                SaveSystemXml.SaveSettings(settings);
            }

            if (resolutionDropdown)
            {
                FindSupportedResolutions();
                Screen.SetResolution(settings.resolution[0], settings.resolution[1], Screen.fullScreen);
            }

            if (qualityDropdown)
            {
                qualityDropdown.value = settings.graphicsPreset;
                qualityDropdown.RefreshShownValue();
                QualitySettings.SetQualityLevel(settings.graphicsPreset);
            }

            if (fullscreenDropdown)
            {
                if (settings.fullscreen == true)
                {
                    fullscreenDropdown.value = 1;
                    fullscreenDropdown.RefreshShownValue();
                }
                else
                {
                    fullscreenDropdown.value = 0;
                    fullscreenDropdown.RefreshShownValue();
                }

                Screen.fullScreen = settings.fullscreen;
            }

            if (vsyncDropdown)
            {
                vsyncDropdown.value = settings.vsyncCount;
                vsyncDropdown.RefreshShownValue();
                QualitySettings.vSyncCount = settings.vsyncCount;
            }
        }
Exemple #2
0
 public void SaveSystemSettings()
 {
     SaveSystemXml.SaveSettings(settings);
 }