< Summary

Class:ShortcutsView
Assembly:BuildModeHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/BuildModeHUD/Scripts/Common/ShortcutsView.cs
Covered lines:8
Uncovered lines:0
Coverable lines:8
Total lines:38
Line coverage:100% (8 of 8)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Create()0%110100%
Awake()0%110100%
OnEnable()0%110100%
OnDisable()0%110100%
SetActive(...)0%110100%
OnCloseClick()0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/BuildModeHUD/Scripts/Common/ShortcutsView.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3using UnityEngine.UI;
 4
 5public interface IShortcutsView
 6{
 7    event Action OnCloseButtonClick;
 8
 9    void OnCloseClick();
 10    void SetActive(bool isActive);
 11}
 12
 13public class ShortcutsView : MonoBehaviour, IShortcutsView
 14{
 15    public event Action OnCloseButtonClick;
 16
 17    [SerializeField] internal Button closeButton;
 18
 19    private const string VIEW_PATH = "Common/ShortcutsView";
 20
 21    internal static ShortcutsView Create()
 22    {
 323        var view = Instantiate(Resources.Load<GameObject>(VIEW_PATH)).GetComponent<ShortcutsView>();
 324        view.gameObject.name = "_ShortcutsView";
 25
 326        return view;
 27    }
 28
 629    private void Awake() { closeButton.onClick.AddListener(OnCloseClick); }
 30
 831    private void OnEnable() { AudioScriptableObjects.dialogOpen.Play(); }
 32
 833    private void OnDisable() { AudioScriptableObjects.dialogClose.Play(); }
 34
 435    public void SetActive(bool isActive) { gameObject.SetActive(isActive); }
 36
 237    public void OnCloseClick() { OnCloseButtonClick?.Invoke(); }
 38}