| | 1 | | using DCL; |
| | 2 | | using DCL.Rendering; |
| | 3 | | using DCL.SettingsCommon.SettingsControllers.BaseControllers; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers |
| | 7 | | { |
| | 8 | | [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Detail Object Culling", fileName = "DetailObjectCullingCo |
| | 9 | | public class DetailObjectCullingControlController : ToggleSettingsControlController |
| | 10 | | { |
| 2 | 11 | | public override object GetStoredValue() { return currentQualitySetting.enableDetailObjectCulling; } |
| | 12 | |
|
| | 13 | | public override void UpdateSetting(object newValue) |
| | 14 | | { |
| 2 | 15 | | bool newBoolValue = (bool)newValue; |
| 2 | 16 | | currentQualitySetting.enableDetailObjectCulling = newBoolValue; |
| | 17 | |
|
| 2 | 18 | | ICullingController cullingController = Environment.i.platform.cullingController; |
| | 19 | |
|
| 2 | 20 | | if ( cullingController != null ) |
| | 21 | | { |
| 1 | 22 | | cullingController.SetObjectCulling(newBoolValue); |
| 1 | 23 | | cullingController.SetShadowCulling(newBoolValue); |
| 1 | 24 | | cullingController.MarkDirty(); |
| | 25 | | } |
| | 26 | |
|
| 2 | 27 | | CommonSettingsScriptableObjects.detailObjectCullingDisabled.Set(!newBoolValue); |
| 2 | 28 | | } |
| | 29 | | } |
| | 30 | | } |