private void ApplySensitivityPreset(SensitivityPreset preset) { mouseSensitivityX.SetRange(preset.range); mouseSensitivityY.SetRange(preset.range); mouseSensitivityX.SetValue(mouseSensitivityX.value); mouseSensitivityY.SetValue(mouseSensitivityY.value); }
public void SetPreset(SensitivityPreset preset) { int inputPresetIndex = -1; for (int i = 0; i < presets.Length; i++) { if (preset == presets[i]) { inputPresetIndex = i; } } if (inputPresetIndex == -1) //none found { currentPresetIndex = 0; //defaults to first item in dropdown } else { currentPresetIndex = inputPresetIndex; } dropdown.value = currentPresetIndex; }