< Summary

Class:DCL.DCLVoiceChatController
Assembly:VoiceChatController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/VoiceChat/DCLVoiceChatController.cs
Covered lines:15
Uncovered lines:0
Coverable lines:15
Total lines:38
Line coverage:100% (15 of 15)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%440100%
OnDestroy()0%110100%
OnKernelConfigChanged(...)0%110100%
EnableVoiceChat(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/VoiceChat/DCLVoiceChatController.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL
 4{
 5    public class DCLVoiceChatController : MonoBehaviour
 6    {
 7        [Header("InputActions")]
 8        public InputAction_Hold voiceChatAction;
 9        public InputAction_Trigger voiceChatToggleAction;
 10
 11        private InputAction_Hold.Started voiceChatStartedDelegate;
 12        private InputAction_Hold.Finished voiceChatFinishedDelegate;
 13        private InputAction_Trigger.Triggered voiceChatToggleDelegate;
 14
 15        void Awake()
 16        {
 11617            voiceChatStartedDelegate = (action) => DCL.Interface.WebInterface.SendSetVoiceChatRecording(true);
 11618            voiceChatFinishedDelegate = (action) => DCL.Interface.WebInterface.SendSetVoiceChatRecording(false);
 11619            voiceChatToggleDelegate = (action) => DCL.Interface.WebInterface.ToggleVoiceChatRecording();
 11620            voiceChatAction.OnStarted += voiceChatStartedDelegate;
 11621            voiceChatAction.OnFinished += voiceChatFinishedDelegate;
 11622            voiceChatToggleAction.OnTriggered += voiceChatToggleDelegate;
 23
 23224            KernelConfig.i.EnsureConfigInitialized().Then(config => EnableVoiceChat(config.comms.voiceChatEnabled));
 11625            KernelConfig.i.OnChange += OnKernelConfigChanged;
 11626        }
 27        void OnDestroy()
 28        {
 11529            voiceChatAction.OnStarted -= voiceChatStartedDelegate;
 11530            voiceChatAction.OnFinished -= voiceChatFinishedDelegate;
 11531            KernelConfig.i.OnChange -= OnKernelConfigChanged;
 11532        }
 33
 1034        void OnKernelConfigChanged(KernelConfigModel current, KernelConfigModel previous) { EnableVoiceChat(current.comm
 35
 24236        void EnableVoiceChat(bool enable) { CommonScriptableObjects.voiceChatDisabled.Set(!enable); }
 37    }
 38}