< Summary

Class:SpawnObject
Assembly:Test
File(s):D:/--UnityProject/VR/_____ISSTA 26/VR-Basics/Assets/_Course Library/Scripts/Core/SpawnObject.cs
Covered lines:8
Uncovered lines:1
Coverable lines:9
Total lines:24
Line coverage:88.8% (8 of 9)
Covered branches:0
Total branches:0
Covered methods:3
Total methods:3
Method coverage:100% (3 of 3)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SpawnObject()0%000100%
Spawn()0%000100%
OnValidate()0%00075%

File(s)

D:/--UnityProject/VR/_____ISSTA 26/VR-Basics/Assets/_Course Library/Scripts/Core/SpawnObject.cs

#LineLine coverage
 1using UnityEngine;
 2
 3/// <summary>
 4/// Spawn an object at a transform's position
 5/// </summary>
 6public class SpawnObject : MonoBehaviour
 7{
 8    [Tooltip("The object that will be spawned")]
 99    public GameObject originalObject = null;
 10
 11    [Tooltip("The transform where the object is spanwed")]
 912    public Transform spawnPosition = null;
 13
 14    public void Spawn()
 315    {
 316        Instantiate(originalObject, spawnPosition.position, spawnPosition.rotation);
 317    }
 18
 19    private void OnValidate()
 920    {
 921        if (!spawnPosition)
 022            spawnPosition = transform;
 923    }
 24}

Methods/Properties

SpawnObject()
Spawn()
OnValidate()