< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.ShadowResolutionControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/ShadowResolutionControlController.cs
Covered lines:10
Uncovered lines:1
Coverable lines:11
Total lines:37
Line coverage:90.9% (10 of 11)
Covered branches:0
Total branches:0

Metrics

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

File(s)

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

#LineLine coverage
 1using System.Reflection;
 2using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 3using UnityEngine;
 4using UnityEngine.Rendering;
 5using UnityEngine.Rendering.Universal;
 6
 7namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers
 8{
 9    [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Shadow Resolution", fileName = "ShadowResolutionControlCo
 10    public class ShadowResolutionControlController : SpinBoxSettingsControlController
 11    {
 12        private UniversalRenderPipelineAsset lightweightRenderPipelineAsset = null;
 13        private FieldInfo lwrpaShadowResolutionField = null;
 14
 15        public override void Initialize()
 16        {
 217            base.Initialize();
 18
 219            lightweightRenderPipelineAsset = GraphicsSettings.renderPipelineAsset as UniversalRenderPipelineAsset;
 20
 221            if (lightweightRenderPipelineAsset == null)
 022                return;
 23
 224            lwrpaShadowResolutionField = lightweightRenderPipelineAsset.GetType().GetField("m_MainLightShadowmapResoluti
 225        }
 26
 227        public override object GetStoredValue() { return (int)Mathf.Log((int)currentQualitySetting.shadowResolution, 2) 
 28
 29        public override void UpdateSetting(object newValue)
 30        {
 231            currentQualitySetting.shadowResolution = (UnityEngine.Rendering.Universal.ShadowResolution)(256 << (int)newV
 32
 233            if (lightweightRenderPipelineAsset != null)
 234                lwrpaShadowResolutionField?.SetValue(lightweightRenderPipelineAsset, currentQualitySetting.shadowResolut
 235        }
 36    }
 37}