| | 1 | | using DCL.SettingsCommon.SettingsControllers.BaseControllers; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers |
| | 5 | | { |
| | 6 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Draw Distance", fileName = "DrawDistanceControlController |
| | 7 | | public class DrawDistanceControlController : SliderSettingsControlController |
| | 8 | | { |
| 2 | 9 | | public override object GetStoredValue() { return currentQualitySetting.cameraDrawDistance; } |
| | 10 | |
|
| | 11 | | public override void UpdateSetting(object newValue) |
| | 12 | | { |
| 2 | 13 | | currentQualitySetting.cameraDrawDistance = (float)newValue; |
| | 14 | |
|
| 2 | 15 | | if (SceneReferences.i.thirdPersonCamera) |
| 2 | 16 | | SceneReferences.i.thirdPersonCamera.m_Lens.FarClipPlane = currentQualitySetting.cameraDrawDistance; |
| | 17 | |
|
| 2 | 18 | | if (SceneReferences.i.firstPersonCamera) |
| 2 | 19 | | SceneReferences.i.firstPersonCamera.m_Lens.FarClipPlane = currentQualitySetting.cameraDrawDistance; |
| | 20 | |
|
| 2 | 21 | | RenderSettings.fogEndDistance = currentQualitySetting.cameraDrawDistance; |
| 2 | 22 | | RenderSettings.fogStartDistance = currentQualitySetting.cameraDrawDistance * 0.8f; |
| 2 | 23 | | } |
| | 24 | | } |
| | 25 | | } |