< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.SoftShadowsControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/SoftShadowsControlController.cs
Covered lines:9
Uncovered lines:0
Coverable lines:9
Total lines:29
Line coverage:100% (9 of 9)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:2
Method coverage:100% (2 of 2)

Metrics

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

File(s)

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

#LineLine coverage
 1using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 2using UnityEngine;
 3
 4namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers
 5{
 6    [CreateAssetMenu(menuName = "Settings/Controllers/Controls/SoftShadows", fileName = "SoftShadowsControlController")]
 7    public class SoftShadowsControlController : ToggleSettingsControlController
 8    {
 9        public override object GetStoredValue() =>
 210            currentQualitySetting.softShadows;
 11
 12        public override void UpdateSetting(object newValue)
 13        {
 214            currentQualitySetting.softShadows = (bool)newValue;
 15
 216            if (SceneReferences.i.environmentLight)
 17            {
 118                LightShadows shadowType = LightShadows.None;
 19
 120                if (currentQualitySetting.shadows)
 121                    shadowType = currentQualitySetting.softShadows ? LightShadows.Soft : LightShadows.Hard;
 22
 123                SceneReferences.i.environmentLight.shadows = shadowType;
 24            }
 25            else
 126                Debug.LogWarning("Cannot set shadow mode to current light, SceneReferences.i.environmentLight is null");
 127        }
 28    }
 29}