public void LoasSettings() { game_set = JsonUtility.FromJson <game_set>(File.ReadAllText(Application.persistentDataPath + "/DBsettings.json")); antiADropdown.value = game_set.antiA; vSyncDropdown.value = game_set.vSync; textureQDrowdown.value = game_set.vSync; resolutionDropdown.value = game_set.resIndex; fullscreenToggle.isOn = game_set.fullscreen; Screen.fullScreen = game_set.fullscreen; resolutionDropdown.RefreshShownValue(); }
void OnEnable() { game_set = new game_set(); fullscreenToggle.onValueChanged.AddListener(delegate { OnFullScreenToggle(); }); resolutionDropdown.onValueChanged.AddListener(delegate { OnResolutionChange(); }); textureQDrowdown.onValueChanged.AddListener(delegate { OnTextureQChange(); }); antiADropdown.onValueChanged.AddListener(delegate { OnAntiAChange(); }); vSyncDropdown.onValueChanged.AddListener(delegate { OnVsyncChange(); }); applyButton.onClick.AddListener(delegate { OnApplyButtonClick(); }); resolutions = Screen.resolutions; foreach (Resolution resolution in resolutions) { resolutionDropdown.options.Add(new Dropdown.OptionData(resolution.ToString())); } LoasSettings(); }