< Summary

Class:DCL.Tutorial.TutorialStep_Camera
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_Camera.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:42
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%2100%
OnStepFinished()0%2100%
OnStepExecute()0%20400%
CameraMode_OnChange(...)0%12300%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_Camera.cs

#LineLine coverage
 1using System.Collections;
 2using UnityEngine;
 3
 4namespace DCL.Tutorial
 5{
 6    /// <summary>
 7    /// Class that represents the onboarding tutorial step related to how to change the camera view.
 8    /// </summary>
 9    public class TutorialStep_Camera : TutorialStep
 10    {
 11        [SerializeField] AudioEvent audioEventSuccess;
 12
 13        private bool stepIsFinished = false;
 14
 15        public override void OnStepStart()
 16        {
 017            base.OnStepStart();
 18
 019            CommonScriptableObjects.cameraMode.OnChange += CameraMode_OnChange;
 020        }
 21
 22        public override void OnStepFinished()
 23        {
 024            base.OnStepFinished();
 25
 026            CommonScriptableObjects.cameraMode.OnChange -= CameraMode_OnChange;
 027        }
 28
 29        public override IEnumerator OnStepExecute()
 30        {
 031            yield return new WaitUntil(() => stepIsFinished);
 032            yield return new WaitForSeconds(0.5f);
 033            audioEventSuccess.Play(true);
 034        }
 35
 36        private void CameraMode_OnChange(CameraMode.ModeId current, CameraMode.ModeId previous)
 37        {
 038            if (current != previous && mainSection.activeSelf)
 039                stepIsFinished = true;
 040        }
 41    }
 42}