< Summary

Class:DCL.Camera.CameraControllerAudioHandler
Assembly:Camera
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Camera/CameraControllerAudioHandler.cs
Covered lines:5
Uncovered lines:0
Coverable lines:5
Total lines:32
Line coverage:100% (5 of 5)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%110100%
OnSetCameraMode(...)0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/Camera/CameraControllerAudioHandler.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5namespace DCL.Camera
 6{
 7    public class CameraControllerAudioHandler : MonoBehaviour
 8    {
 9        [SerializeField]
 10        CameraController cameraController;
 11
 12        [SerializeField]
 13        AudioEvent eventCameraFadeIn, eventCameraFadeOut;
 14
 119415        private void Awake() { cameraController.onSetCameraMode += OnSetCameraMode; }
 16
 17        void OnSetCameraMode(CameraMode.ModeId mode)
 18        {
 19            switch (mode)
 20            {
 21                case CameraMode.ModeId.FirstPerson:
 122                    eventCameraFadeIn.Play(true);
 123                    break;
 24                case CameraMode.ModeId.ThirdPerson:
 125                    eventCameraFadeOut.Play(true);
 26                    break;
 27                default:
 28                    break;
 29            }
 130        }
 31    }
 32}