< Summary

Class:AudioEvent_WithRandomPitch
Assembly:Audio
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Audio/AudioEvent_WithRandomPitch.cs
Covered lines:3
Uncovered lines:1
Coverable lines:4
Total lines:16
Line coverage:75% (3 of 4)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:2
Method coverage:50% (1 of 2)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize(...)0%110100%
OnEventPlay()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Audio/AudioEvent_WithRandomPitch.cs

#LineLine coverage
 1using UnityEngine;
 2
 3[CreateAssetMenu(fileName = "AudioEventWithRandomPitch", menuName = "AudioEvents/AudioEvent - With random pitch")]
 4public class AudioEvent_WithRandomPitch : AudioEvent
 5{
 6    [SerializeField]
 7    float pitchMaxVariation;
 8
 9    public override void Initialize(AudioContainer audioContainer)
 10    {
 2511        base.Initialize(audioContainer);
 2512        OnPlay += OnEventPlay;
 2513    }
 14
 015    void OnEventPlay() { SetPitch(pitch + Random.Range(-pitchMaxVariation, pitchMaxVariation)); }
 16}