< Summary

Class:DCL.SettingsCommon.SettingsControllers.SpecificControllers.ShadowControlController
Assembly:SettingsControllers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Settings/SettingsControllers/SpecificControllers/ShadowControlController.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:31
Line coverage:100% (10 of 10)
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/ShadowControlController.cs

#LineLine coverage
 1using DCL.SettingsCommon.SettingsControllers.BaseControllers;
 2using UnityEngine;
 3
 4namespace DCL.SettingsCommon.SettingsControllers.SpecificControllers
 5{
 6    [CreateAssetMenu(menuName = "Settings/Controllers/Controls/Shadow", fileName = "ShadowControlController")]
 7    public class ShadowControlController : ToggleSettingsControlController
 8    {
 9        public override object GetStoredValue() =>
 210            currentQualitySetting.shadows;
 11
 12        public override void UpdateSetting(object newValue)
 13        {
 214            currentQualitySetting.shadows = (bool)newValue;
 15
 216            if (SceneReferences.i.environmentLight)
 17            {
 118                LightShadows shadowType = LightShadows.None;
 19
 120                if (currentQualitySetting.shadows)
 121                    shadowType = currentQualitySetting.shadows ? 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");
 27
 228            CommonSettingsScriptableObjects.shadowsDisabled.Set(!currentQualitySetting.shadows);
 229        }
 30    }
 31}