public override GameObject InitializeElement() { groupNames = PerformanceHUDManager.GetNames(); int locationOfVariable = 0; string value = getValue(); for (int i = 0; i < groupNames.Length; i++) { if (groupNames[i] == value) { locationOfVariable = i; break; } } GameObject go = DropdownHelperFromText(groupNames, locationOfVariable); dropdownElement.onValueChanged.AddListener( (int v) => { if (v != selectedValue) { valueChanged = true; selectedValue = v; } }); return(go); }
public void OnApply() { LocalizationTable.SetLocalization(languageDropdown.value); if (WorldController.Instance != null) { WorldController.Instance.spawnInventoryController.SetUIVisibility(developerModeToggle.isOn); } // MasterTextureLimit should get 0 for High quality and higher values for lower qualities. // For example count is 3 (0:Low, 1:Med, 2:High). // For High: count - 1 - value = 3 - 1 - 2 = 0 (therefore no limit = high quality). // For Med: count - 1 - value = 3 - 1 - 1 = 1 (therefore a slight limit = medium quality). // For Low: count - 1 - value = 3 - 1 - 0 = 1 (therefore more limit = low quality). QualitySettings.masterTextureLimit = qualityDropdown.options.Count - 1 - qualityDropdown.value; Screen.fullScreen = fullScreenToggle.isOn; ResolutionOption selectedOption = (ResolutionOption)resolutionDropdown.options[resolutionDropdown.value]; Resolution resolution = selectedOption.Resolution; Screen.SetResolution(resolution.width, resolution.height, fullScreenToggle.isOn, resolution.refreshRate); if (WorldController.Instance != null) { WorldController.Instance.autosaveManager.SetAutosaveInterval(int.Parse(autosaveInterval.text)); } // One to many but we want an applying feature; PerformanceHUDManager.DirtyUI(); }
public void OnApply() { if (WorldController.Instance != null) { WorldController.Instance.spawnInventoryController.SetUIVisibility(developerModeToggle.isOn); } // One to many but we want an applying feature; PerformanceHUDManager.DirtyUI(); }
/// <summary> /// Singleton management. /// </summary> private void Awake() { if (instance == this || instance == null) { instance = this; } else { UnityDebugger.Debugger.LogError("There can only be one PerformanceHUD per 'game'. Deleting instance with name: " + gameObject.name); Destroy(gameObject); } }
/// <summary> /// Saves settings to Settings.xml via the Settings class. /// </summary> public void SaveSetting() { Settings.SetSetting("DialogBoxSettings_musicVolume", musicVolume.normalizedValue); Settings.SetSetting("DialogBoxSettings_fullScreenToggle", fullScreenToggle.isOn); Settings.SetSetting("DialogBoxSettings_developerModeToggle", developerModeToggle.isOn); Settings.SetSetting("DialogBoxSettings_performanceGroup", performanceDropdown.value); Settings.SetSetting("DialogBoxSettings_qualityDropdown", qualityDropdown.value); Settings.SetSetting("DialogBoxSettings_vSyncDropdown", vsyncDropdown.value); Settings.SetSetting("DialogBoxSettings_resolutionDropdown", resolutionDropdown.value); Settings.SaveSettings(); PerformanceHUDManager.DirtyUI(); }
/// <summary> /// Saves settings to Settings.xml via the Settings class. /// </summary> public void SaveSetting() { Settings.SetSetting("DialogBoxSettingsDevConsole_devConsoleToggle", developerConsoleToggle.isOn); Settings.SetSetting("DialogBoxSettingsDevConsole_developerModeToggle", developerModeToggle.isOn); Settings.SetSetting("DialogBoxSettingsDevConsole_timeStampToggle", timeStampToggle.isOn); Settings.SetSetting("DialogBoxSettingsDevConsole_performanceGroup", performanceDropdown.value); Settings.SetSetting("DialogBoxSettingsDevConsole_scrollSensitivity", scrollingSensitivity.value); Settings.SetSetting("DialogBoxSettingsDevConsole_consoleFontSize", (int)fontSize.value); Settings.SaveSettings(); PerformanceHUDManager.DirtyUI(); DeveloperConsole.DevConsole.DirtySettings(); }
/// <summary> /// Saves settings to Settings.xml via the Settings class. /// </summary> public void SaveSetting() { Settings.SetSetting("DialogBoxSettings_musicVolume", musicVolume.normalizedValue); Settings.SetSetting("DialogBoxSettings_fullScreenToggle", fullScreenToggle.isOn); Settings.SetSetting("DialogBoxSettings_qualityDropdown", qualityDropdown.value); Settings.SetSetting("DialogBoxSettings_vSyncDropdown", vsyncDropdown.value); Settings.SetSetting("DialogBoxSettings_resolutionDropdown", resolutionDropdown.value); Settings.SetSetting("AutosaveInterval", int.Parse(autosaveInterval.text)); Settings.SetSetting("AutosaveFiles", int.Parse(autosaveFiles.text)); Settings.SaveSettings(); PerformanceHUDManager.DirtyUI(); }
public override void CancelSetting() { base.CancelSetting(); PerformanceHUDManager.DirtyUI(); }
public override void ApplySetting() { base.ApplySetting(); Settings.SetSetting(option.key, groupNames[selectedValue]); PerformanceHUDManager.DirtyUI(); }
public override void ApplySetting() { base.ApplySetting(); PerformanceHUDManager.DirtyUI(); }