< Summary

Class:SwitchToggle
Assembly:UIHelpers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/UIHelpers/SwitchToggle/Scripts/SwitchToggle.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:24
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:4
Method coverage:0% (0 of 4)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SwitchToggle()0%2100%
Awake()0%2100%
OnEnable()0%2100%
OnValueChanged(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/UIHelpers/SwitchToggle/Scripts/SwitchToggle.cs

#LineLine coverage
 1using UnityEngine;
 2using UnityEngine.UI;
 3
 4public class SwitchToggle : Toggle
 5{
 06    private static readonly int animatorOnBoolean = Animator.StringToHash("isOn");
 7
 8    [SerializeField] Animator switchAnimator;
 9
 10    protected override void Awake()
 11    {
 012        base.Awake();
 013        OnValueChanged(this.isOn);
 014        this.onValueChanged.AddListener(OnValueChanged);
 015    }
 16
 17    protected override void OnEnable()
 18    {
 019        base.OnEnable();
 020        OnValueChanged(this.isOn);
 021    }
 22
 023    private void OnValueChanged(bool value) { switchAnimator.SetBool(animatorOnBoolean, value); }
 24}