< Summary

Class:CubeInteractable
Assembly:Test
File(s):D:/--UnityProject/VR/VRExplorer_subjects/EscapeGameVR/Assets/Scripts/Test/CubeInteractable.cs
Covered lines:0
Uncovered lines:16
Coverable lines:16
Total lines:38
Line coverage:0% (0 of 16)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:3
Method coverage:0% (0 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%0000%
Update()0%0000%
OnCollisionEnter(...)0%0000%

File(s)

D:/--UnityProject/VR/VRExplorer_subjects/EscapeGameVR/Assets/Scripts/Test/CubeInteractable.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5public class CubeInteractable : MonoBehaviour
 6{
 7
 8    [SerializeField] private Material newMaterial;
 9
 10    // Start is called before the first frame update
 11    void Start()
 012    {
 13
 014    }
 15
 16    // Update is called once per frame
 17    void Update()
 018    {
 19
 020    }
 21
 22    private void OnCollisionEnter(Collision collision) //Un appel par collision, donc si l'objet touche 6 autres objets,
 023    {
 24
 025        if (collision.gameObject.layer == LayerMask.NameToLayer("Platform") )
 026        {
 027            if (collision.gameObject.GetComponent<Renderer>().sharedMaterial == this.gameObject.GetComponent<Renderer>()
 28
 029            {
 030                Destroy(this.gameObject);
 031            }
 32            else
 033            {
 034                collision.gameObject.GetComponent<Renderer>().material = newMaterial;
 035            }
 036        }
 037    }
 38}