< Summary

Class:UIHoverObjectToggler
Assembly:HUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/UIHoverObjectToggler.cs
Covered lines:5
Uncovered lines:1
Coverable lines:6
Total lines:21
Line coverage:83.3% (5 of 6)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnPointerEnter(...)0%2100%
OnPointerExit(...)0%110100%
OnDisable()0%110100%
SetObjectsActiveState(...)0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/UIHoverObjectToggler.cs

#LineLine coverage
 1using UnityEngine;
 2using UnityEngine.EventSystems;
 3
 4public class UIHoverObjectToggler : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
 5{
 6    public GameObject[] targetObjects;
 7
 08    public void OnPointerEnter(PointerEventData eventData) { SetObjectsActiveState(true); }
 9
 35610    public void OnPointerExit(PointerEventData eventData) { SetObjectsActiveState(false); }
 11
 35612    void OnDisable() { OnPointerExit(null); }
 13
 14    void SetObjectsActiveState(bool newState)
 15    {
 71216        for (int i = 0; i < targetObjects.Length; i++)
 17        {
 17818            targetObjects[i].SetActive(newState);
 19        }
 17820    }
 21}