< Summary

Class:SectionProjectScenesView
Assembly:BuilderProjectsPanel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/Views/MenuSections/SectionProjectScenesView.cs
Covered lines:8
Uncovered lines:5
Coverable lines:13
Total lines:42
Line coverage:61.5% (8 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetParent(...)0%2100%
SetActive(...)0%2100%
ResetScrollRect()0%110100%
Dispose()0%220100%
Awake()0%110100%
OnDestroy()0%110100%
OnScrollValueChanged(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/Views/MenuSections/SectionProjectScenesView.cs

#LineLine coverage
 1using System;
 2using DCL.Helpers;
 3using UnityEngine;
 4using UnityEngine.UI;
 5
 6internal class SectionProjectScenesView : MonoBehaviour, IDisposable
 7{
 8    public event Action OnScrollRectValueChanged;
 9
 10    [SerializeField] public Transform scenesCardContainer;
 11    [SerializeField] public ScrollRect scrollRect;
 12
 13    private bool isDestroyed = false;
 14
 15    public void SetParent(Transform parent)
 16    {
 017        transform.SetParent(parent);
 018        transform.ResetLocalTRS();
 019    }
 20
 021    public void SetActive(bool active) { gameObject.SetActive(active); }
 22
 223    public void ResetScrollRect() { scrollRect.verticalNormalizedPosition = 1; }
 24
 25    public void Dispose()
 26    {
 127        if (!isDestroyed)
 28        {
 129            Destroy(gameObject);
 30        }
 131    }
 32
 433    private void Awake() { scrollRect.onValueChanged.AddListener(OnScrollValueChanged); }
 34
 35    private void OnDestroy()
 36    {
 237        isDestroyed = true;
 238        scrollRect.onValueChanged.RemoveListener(OnScrollValueChanged);
 239    }
 40
 041    private void OnScrollValueChanged(Vector2 value) { OnScrollRectValueChanged?.Invoke(); }
 42}