< Summary

Class:PreviewMenuView
Assembly:DebugPlugins_PreviewMenu
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/DebugPlugins/PreviewMenu/View/Scripts/PreviewMenuView.cs
Covered lines:14
Uncovered lines:0
Coverable lines:14
Total lines:43
Line coverage:100% (14 of 14)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%110100%
OnDestroy()0%110100%
Dispose()0%220100%
AddMenuItem(...)0%110100%
SetVisible(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/DebugPlugins/PreviewMenu/View/Scripts/PreviewMenuView.cs

#LineLine coverage
 1using UnityEngine;
 2using UnityEngine.UI;
 3
 4internal class PreviewMenuView : MonoBehaviour
 5{
 6    [SerializeField] internal Button menuButton;
 7    [SerializeField] internal GameObject contentContainer;
 8    [SerializeField] internal Transform menuList;
 9
 10    private bool isDestroyed;
 11
 12    private void Awake()
 13    {
 714        menuButton.onClick.AddListener(() =>
 15        {
 216            SetVisible(!contentContainer.activeSelf);
 217        });
 718    }
 19
 20    private void OnDestroy()
 21    {
 722        isDestroyed = true;
 723    }
 24
 25    public void Dispose()
 26    {
 527        if (!isDestroyed)
 28        {
 529            Destroy(gameObject);
 30        }
 531    }
 32
 33    public void AddMenuItem(Transform item)
 34    {
 1635        item.SetParent(menuList);
 1636        item.localScale = Vector3.one;
 1637    }
 38
 39    public void SetVisible(bool on)
 40    {
 741        contentContainer.SetActive(on);
 742    }
 43}