< Summary

Class:LightCandle
Assembly:Test
File(s):E:/Unity/Unity Project/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs
Covered lines:10
Uncovered lines:6
Coverable lines:16
Total lines:53
Line coverage:62.5% (10 of 16)
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
LightCandle()0%000100%
Start()0%000100%
Update()0%00050%
OnCollisionEnter(...)0%00050%

File(s)

E:/Unity/Unity Project/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs

#LineLine coverage
 1using BNG;
 2using System.Diagnostics.CodeAnalysis;
 3using UnityEngine;
 4using HenryLab;
 5
 6public class LightCandle : MonoBehaviour, IGrabbableEntity
 7{
 8    [ExcludeFromCodeCoverage]
 9    public Grabbable Grabbable
 10    {
 11        get
 12        {
 13            var g = GetComponent<Grabbable>();
 14            if (g) return g;
 15            return gameObject.AddComponent<Grabbable>();
 16        }
 17    }
 18    [ExcludeFromCodeCoverage] public string Name => Str.Grabbable;
 19
 20    [ExcludeFromCodeCoverage] public Transform Destination => null;
 21
 22
 23    [ExcludeFromCodeCoverage]
 24    public void OnGrabbed()
 25    {
 26    }
 27
 28    public ParticleSystem flames;
 29    private Rigidbody rigidbody;
 230    public float velocityThreshold = 0.5f;
 31    void Start()
 132    {
 133        rigidbody = GetComponent<Rigidbody>();
 134    }
 35    void Update()
 86536    {
 86537        if (rigidbody.velocity.magnitude >= velocityThreshold)
 038        {
 039            flames.Stop();
 040        }
 86541    }
 42    void OnCollisionEnter(Collision collision)
 143    {
 144        if (collision.gameObject.CompareTag("Player"))
 045        {
 046            flames.Play();
 047        }
 148    }
 49    [ExcludeFromCodeCoverage]
 50    public void OnReleased()
 51    {
 52    }
 53}