< Summary

Class:LightCandle
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_subjects/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs
Covered lines:16
Uncovered lines:0
Coverable lines:16
Total lines:46
Line coverage:100% (16 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%000100%
OnCollisionEnter(...)0%000100%

File(s)

D:/--UnityProject/VR/VRExplorer_subjects/VR-Room/Assets/_Course Library/Scripts/Test/LightCandle.cs

#LineLine coverage
 1using BNG;
 2using System.Diagnostics.CodeAnalysis;
 3using UnityEngine;
 4using VRExplorer;
 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]
 21    public void OnGrabbed()
 22    {
 23    }
 24
 25    public ParticleSystem flames;
 26    private Rigidbody rigidbody;
 527    public float velocityThreshold = 0.5f;
 28    void Start()
 429    {
 430        rigidbody = GetComponent<Rigidbody>();
 431    }
 32    void Update()
 676733    {
 676734        if(rigidbody.velocity.magnitude >= velocityThreshold)
 17435        {
 17436            flames.Stop();
 17437        }
 676738    }
 39    void OnCollisionEnter(Collision collision)
 1140    {
 1141        if(collision.gameObject.CompareTag("Player"))
 242        {
 243            flames.Play();
 244        }
 1145    }
 46}