< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.DetailObjectCullingSizeControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/DetailObjectCullingSizeControlController.cs
Covered lines:8
Uncovered lines:3
Coverable lines:11
Total lines:44
Line coverage:72.7% (8 of 11)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetStoredValue()0%110100%
UpdateSetting(...)0%4.434070%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/DetailObjectCullingSizeControlController.cs

#LineLine coverage
 1using DCL.Rendering;
 2using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 3using UnityEngine;
 4using Environment = DCL.Environment;
 5
 6namespace 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;
 212        public override object GetStoredValue() { return currentQualitySetting.detailObjectCullingLimit; }
 13
 14        public override void UpdateSetting(object newValue)
 15        {
 216            currentQualitySetting.detailObjectCullingLimit = (float)newValue;
 17
 218            if (currentQualitySetting.enableDetailObjectCulling)
 19            {
 220                var cullingController = Environment.i.platform.cullingController;
 21
 222                if ( cullingController != null )
 23                {
 124                    var settings = cullingController.GetSettingsCopy();
 25
 126                    if ( settings != null )
 27                    {
 028                        settings.rendererProfile = CullingControllerProfile.Lerp(
 29                            cullingControllerSettingsData.rendererProfileMin,
 30                            cullingControllerSettingsData.rendererProfileMax,
 31                            currentQualitySetting.detailObjectCullingLimit / 100.0f);
 32
 033                        settings.skinnedRendererProfile = CullingControllerProfile.Lerp(
 34                            cullingControllerSettingsData.skinnedRendererProfileMin,
 35                            cullingControllerSettingsData.skinnedRendererProfileMax,
 36                            currentQualitySetting.detailObjectCullingLimit / 100.0f);
 37
 038                        cullingController.SetSettings(settings);
 39                    }
 40                }
 41            }
 242        }
 43    }
 44}