| | 1 | | using DCL.SettingsCommon.SettingsControllers.BaseControllers; |
| | 2 | | using UnityEngine; |
| | 3 | | using UnityEngine.Rendering; |
| | 4 | | using UnityEngine.Rendering.Universal; |
| | 5 | |
|
| | 6 | | namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers |
| | 7 | | { |
| | 8 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Shadow Distance", fileName = "ShadowDistanceControlContro |
| | 9 | | public class ShadowDistanceControlController : SliderSettingsControlController |
| | 10 | | { |
| | 11 | | private UniversalRenderPipelineAsset lightweightRenderPipelineAsset = null; |
| | 12 | |
|
| | 13 | | public override void Initialize() |
| | 14 | | { |
| 2 | 15 | | base.Initialize(); |
| | 16 | |
|
| 2 | 17 | | lightweightRenderPipelineAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset; |
| 2 | 18 | | } |
| | 19 | |
|
| 2 | 20 | | public override object GetStoredValue() { return currentQualitySetting.shadowDistance; } |
| | 21 | |
|
| | 22 | | public override void UpdateSetting(object newValue) |
| | 23 | | { |
| 2 | 24 | | currentQualitySetting.shadowDistance = (float)newValue; |
| | 25 | |
|
| 2 | 26 | | if (lightweightRenderPipelineAsset) |
| 2 | 27 | | lightweightRenderPipelineAsset.shadowDistance = currentQualitySetting.shadowDistance; |
| 2 | 28 | | } |
| | 29 | | } |
| | 30 | | } |