void SetupCameraSensitivityControls() { // Check whether to show the keyboard controls set or not bool enabled = enableCameraSensitivityControls.IsSupported(); // Toggle the display of the controls cameraSensitivitySet.gameObject.SetActive(enabled); // Check if enabled if (enabled == true) { // If so, setup the UI cameraSensitivitySet.Setup(Settings.MouseXAxisSensitivity, Settings.MouseYAxisSensitivity, Settings.IsMouseAxisSensitivitySplit, Settings.IsMouseXAxisInverted, Settings.IsMouseYAxisInverted); // Bind to the events on any changes to the control set cameraSensitivitySet.OnBothAxisSensitivitySlider += CameraSensitivitySet_OnHorizontalSensitivitySlider; cameraSensitivitySet.OnHorizontalSensitivitySlider += CameraSensitivitySet_OnHorizontalSensitivitySlider; cameraSensitivitySet.OnVerticalSensitivitySlider += CameraSensitivitySet_OnVerticalSensitivitySlider; cameraSensitivitySet.OnInvertHorizontalAxisCheckboxChanged += CameraSensitivitySet_OnInvertHorizontalAxisCheckboxChanged; cameraSensitivitySet.OnInvertVerticalAxisCheckboxChanged += CameraSensitivitySet_OnInvertVerticalAxisCheckboxChanged; } }
void SetupKeyboardSensitivityControls() { // Check whether to show the keyboard controls set or not bool enabled = enableKeyboardControls.IsThisBuildSupported(); // Toggle the display of the controls keyboardSensitivitySet.gameObject.SetActive(enabled); // Check if enabled if (enabled == true) { // If so, setup the UI keyboardSensitivitySet.Setup(Settings.KeyboardXAxisSensitivity, Settings.KeyboardYAxisSensitivity, Settings.IsKeyboardAxisSensitivitySplit, Settings.IsKeyboardXAxisInverted, Settings.IsKeyboardYAxisInverted); // Bind to the events on any changes to the control set keyboardSensitivitySet.OnBothAxisSensitivitySlider += KeyboardSensitivitySet_OnHorizontalSensitivitySlider; keyboardSensitivitySet.OnHorizontalSensitivitySlider += KeyboardSensitivitySet_OnHorizontalSensitivitySlider; keyboardSensitivitySet.OnVerticalSensitivitySlider += KeyboardSensitivitySet_OnVerticalSensitivitySlider; keyboardSensitivitySet.OnInvertHorizontalAxisCheckboxChanged += KeyboardSensitivitySet_OnInvertHorizontalAxisCheckboxChanged; keyboardSensitivitySet.OnInvertVerticalAxisCheckboxChanged += KeyboardSensitivitySet_OnInvertVerticalAxisCheckboxChanged; } }