< Summary

Class:SmartItemBooleanParameterAdapter
Assembly:BuilderInWorldEntityInformation
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/BuilderMode/EntityInformation/SmartItems/Parameters/SmartItemBooleanParameterAdapter.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:24
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%2100%
SetInfo()0%6200%
OnValueChange(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/BuilderMode/EntityInformation/SmartItems/Parameters/SmartItemBooleanParameterAdapter.cs

#LineLine coverage
 1using DCL.Components;
 2using System.Collections;
 3using System.Collections.Generic;
 4using UnityEngine;
 5using UnityEngine.UI;
 6
 7public class SmartItemBooleanParameterAdapter : SmartItemUIParameterAdapter
 8{
 9    public Toggle boolParameterToggle;
 10
 011    private void Start() { boolParameterToggle.onValueChanged.AddListener(OnValueChange); }
 12
 13    public override void SetInfo()
 14    {
 015        base.SetInfo();
 16
 017        boolParameterToggle.gameObject.SetActive(true);
 18
 019        if (bool.TryParse(GetParameterValue().ToString(), out bool defaultParameter))
 020            boolParameterToggle.isOn = defaultParameter;
 021    }
 22
 023    public void OnValueChange(bool value) { SetParameterValue(value); }
 24}