< Summary

Class:HouseController
Assembly:Assembly-CSharp
File(s):D:/--UnityProject/VR/_____ISSTA 26/Island-Visualizer-PCVR/Assets/Scripts/Test/HouseController.cs
Covered lines:18
Uncovered lines:5
Coverable lines:23
Total lines:46
Line coverage:78.2% (18 of 23)
Covered branches:0
Total branches:0
Covered methods:4
Total methods:4
Method coverage:100% (4 of 4)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
HouseController()0%000100%
Start()0%000100%
Update()0%00037.5%
changeLights()0%00092.86%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/Island-Visualizer-PCVR/Assets/Scripts/Test/HouseController.cs

#LineLine coverage
 1using UnityEngine;
 2
 3public class HouseController : MonoBehaviour
 4{
 5    public GameObject[] windowGlassObjects;
 6
 7    [ColorUsage(true, true)]
 8    public Color lightsOnEmissionColor;
 9
 10    [ColorUsage(true, true)]
 11    public Color lightsOffEmissionColor;
 12
 613    public bool lightStatus = false;
 614    private bool currentLightStatus = false;
 15    public AudioSource switchSound;
 16
 17    private void Start()
 218    {
 219        changeLights();
 220    }
 21
 22    private void Update()
 31923    {
 31924        if (currentLightStatus != lightStatus)
 025        {
 026            currentLightStatus = lightStatus;
 027            changeLights();
 028            switchSound.Play();
 029        }
 31930    }
 31
 32    public void changeLights()
 333    {
 334        Color colorChange = lightsOffEmissionColor;
 335        if (currentLightStatus == true) colorChange = lightsOnEmissionColor;
 3336        foreach (GameObject targetObject in windowGlassObjects)
 1237        {
 1238            Material targetMaterial = targetObject.GetComponent<Renderer>().material;
 39            // Set the new HDR color to the material's emission color property
 1240            targetMaterial.SetColor("_EmissionColor", colorChange);
 41
 42            // Enable emission on the material (if it's not already enabled)
 1243            targetMaterial.EnableKeyword("_EMISSION");
 1244        }
 345    }
 46}