| | 1 | | using DCL.Rendering; |
| | 2 | | using DCL.SettingsCommon.SettingsControllers.BaseControllers; |
| | 3 | | using UnityEngine; |
| | 4 | | using Environment = DCL.Environment; |
| | 5 | |
|
| | 6 | | namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers |
| | 7 | | { |
| | 8 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Detail Object Culling Size", fileName = "DetailObjectCull |
| | 9 | | public class DetailObjectCullingSizeControlController : SliderSettingsControlController |
| | 10 | | { |
| | 11 | | public CullingControllerSettingsData cullingControllerSettingsData; |
| 2 | 12 | | public override object GetStoredValue() { return currentQualitySetting.detailObjectCullingLimit; } |
| | 13 | |
|
| | 14 | | public override void UpdateSetting(object newValue) |
| | 15 | | { |
| 2 | 16 | | currentQualitySetting.detailObjectCullingLimit = (float)newValue; |
| | 17 | |
|
| 2 | 18 | | if (currentQualitySetting.enableDetailObjectCulling) |
| | 19 | | { |
| 2 | 20 | | var cullingController = Environment.i.platform.cullingController; |
| | 21 | |
|
| 2 | 22 | | if ( cullingController != null ) |
| | 23 | | { |
| 1 | 24 | | var settings = cullingController.GetSettingsCopy(); |
| | 25 | |
|
| 1 | 26 | | if ( settings != null ) |
| | 27 | | { |
| 0 | 28 | | settings.rendererProfile = CullingControllerProfile.Lerp( |
| | 29 | | cullingControllerSettingsData.rendererProfileMin, |
| | 30 | | cullingControllerSettingsData.rendererProfileMax, |
| | 31 | | currentQualitySetting.detailObjectCullingLimit / 100.0f); |
| | 32 | |
|
| 0 | 33 | | settings.skinnedRendererProfile = CullingControllerProfile.Lerp( |
| | 34 | | cullingControllerSettingsData.skinnedRendererProfileMin, |
| | 35 | | cullingControllerSettingsData.skinnedRendererProfileMax, |
| | 36 | | currentQualitySetting.detailObjectCullingLimit / 100.0f); |
| | 37 | |
|
| 0 | 38 | | cullingController.SetSettings(settings); |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |
| 2 | 42 | | } |
| | 43 | | } |
| | 44 | | } |