| | 1 | | using DCL.Interface; |
| | 2 | | using DCL.SettingsCommon.SettingsControllers.BaseControllers; |
| | 3 | | using UnityEngine; |
| | 4 | |
|
| | 5 | | namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers |
| | 6 | | { |
| | 7 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Invert Y Axis", fileName = "InvertYAxisControlController" |
| | 8 | | public class InvertYAxisControlController : ToggleSettingsControlController |
| | 9 | | { |
| | 10 | |
|
| | 11 | | public override void Initialize() |
| | 12 | | { |
| 2 | 13 | | base.Initialize(); |
| 2 | 14 | | DataStore.i.camera.invertYAxis.OnChange += InvertYAxisChanged; |
| 2 | 15 | | } |
| | 16 | |
|
| 2 | 17 | | public override object GetStoredValue() { return currentGeneralSettings.invertYAxis; } |
| | 18 | |
|
| | 19 | | public override void UpdateSetting(object newValue) |
| | 20 | | { |
| 2 | 21 | | currentGeneralSettings.invertYAxis = (bool)newValue; |
| 2 | 22 | | DataStore.i.camera.invertYAxis.Set((bool)newValue); |
| 2 | 23 | | } |
| | 24 | |
|
| | 25 | | private void InvertYAxisChanged(bool current, bool previous) |
| | 26 | | { |
| 1 | 27 | | currentGeneralSettings.invertYAxis = current; |
| 1 | 28 | | ApplySettings(); |
| 1 | 29 | | } |
| | 30 | | } |
| | 31 | | } |