< Summary

Class:OtherLaneController
Assembly:Assembly-CSharp
File(s):D:/--UnityProject/VR/_____ISSTA 26/BowlingVR/Assets/Script/Test/OtherLaneController.cs
Covered lines:4
Uncovered lines:14
Coverable lines:18
Total lines:38
Line coverage:22.2% (4 of 18)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:2
Method coverage:50% (1 of 2)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnTriggerEnter()0%00040%
GeneraBola(...)0%0000%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/BowlingVR/Assets/Script/Test/OtherLaneController.cs

#LineLine coverage
 1using System.Collections;
 2using TMPro;
 3using UnityEngine;
 4
 5public class OtherLaneController : MonoBehaviour
 6{
 7    public Transform aparicionBola;
 8    public GameObject bolaPrefab;
 9
 10    private IEnumerator OnTriggerEnter(Collider other)
 6011    {
 6012        yield return new WaitForSeconds(5);
 6013        if (other.tag == "Ball")
 014        {
 015            var peso = other.GetComponent<BallSoundController>().peso;
 016            var pesoEnKgs = other.GetComponent<BallSoundController>().pesoEnKgs;
 17
 18
 19            //Se destruye la bola
 020            Destroy(other.gameObject);
 21
 22
 023            GeneraBola(bolaPrefab, pesoEnKgs, peso);
 024        }
 6025    }
 26
 27    private void GeneraBola(GameObject bola, int pesoKgs, float peso)
 028    {
 029        var bolaControll = bola.GetComponent<BallSoundController>();
 030        bolaControll.peso = peso;
 031        bolaControll.pesoEnKgs = pesoKgs;
 032        bolaControll.changePeso();
 33
 034        var miBola = Instantiate(bola, aparicionBola.position, aparicionBola.rotation);
 035        miBola.GetComponent<Rigidbody>().AddForce(new Vector3(1, 0, 0) * 1.5f, ForceMode.Impulse);
 036    }
 37
 38}