< 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:0
Coverable lines:8
Total lines:36
Line coverage:100% (8 of 8)
Covered branches:0
Total branches:0

Metrics

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

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            {
 120                var settings = Environment.i.platform.cullingController.GetSettingsCopy();
 21
 122                settings.rendererProfile = CullingControllerProfile.Lerp(
 23                    cullingControllerSettingsData.rendererProfileMin,
 24                    cullingControllerSettingsData.rendererProfileMax,
 25                    currentQualitySetting.detailObjectCullingLimit / 100.0f);
 26
 127                settings.skinnedRendererProfile = CullingControllerProfile.Lerp(
 28                    cullingControllerSettingsData.skinnedRendererProfileMin,
 29                    cullingControllerSettingsData.skinnedRendererProfileMax,
 30                    currentQualitySetting.detailObjectCullingLimit / 100.0f);
 31
 132                Environment.i.platform.cullingController.SetSettings(settings);
 33            }
 234        }
 35    }
 36}