< Summary

Class:DestroyParticlesOnFinish
Assembly:Utils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/DestroyParticlesOnFinish.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:32
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%6200%
FixedUpdate()0%20400%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/DestroyParticlesOnFinish.cs

#LineLine coverage
 1using UnityEngine;
 2
 3public class DestroyParticlesOnFinish : MonoBehaviour
 4{
 5    private const int INDEX_AMOUNT = 10;
 6
 7    [SerializeField] private ParticleSystem particles;
 8    private int index;
 9
 10
 11    private void Awake()
 12    {
 013        if (particles == null)
 14        {
 015            Destroy(this);
 016            return;
 17        }
 18
 019        index = Random.Range(0, INDEX_AMOUNT);
 020    }
 21
 22    public void FixedUpdate()
 23    {
 024        if (Time.frameCount % INDEX_AMOUNT != index)
 025            return;
 26
 027        if (particles == null || particles.IsAlive())
 028          return;
 29
 030        Destroy(gameObject);
 031    }
 32}

Methods/Properties

Awake()
FixedUpdate()