| | 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/Rendering Scale", fileName = "RenderingScaleControlContro |
| | 9 | | public class RenderingScaleControlController : SliderSettingsControlController |
| | 10 | | { |
| | 11 | | private UniversalRenderPipelineAsset lightweightRenderPipelineAsset = null; |
| | 12 | |
|
| | 13 | | public override void Initialize() |
| | 14 | | { |
| 2 | 15 | | base.Initialize(); |
| | 16 | |
|
| 2 | 17 | | if (lightweightRenderPipelineAsset == null) |
| 2 | 18 | | lightweightRenderPipelineAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset; |
| 2 | 19 | | } |
| | 20 | |
|
| 2 | 21 | | public override object GetStoredValue() { return currentQualitySetting.renderScale; } |
| | 22 | |
|
| | 23 | | public override void UpdateSetting(object newValue) |
| | 24 | | { |
| 2 | 25 | | currentQualitySetting.renderScale = (float)newValue; |
| | 26 | |
|
| 2 | 27 | | if (lightweightRenderPipelineAsset != null) |
| | 28 | | { |
| 2 | 29 | | lightweightRenderPipelineAsset.renderScale = currentQualitySetting.renderScale; |
| | 30 | | } |
| | 31 | |
|
| 2 | 32 | | RaiseOnIndicatorLabelChange(currentQualitySetting.renderScale.ToString("0.0")); |
| 2 | 33 | | } |
| | 34 | | } |
| | 35 | | } |