< 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:13
Uncovered lines:0
Coverable lines:13
Total lines:42
Line coverage:100% (13 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%110100%
OnStepFinished()0%110100%
OnStepExecute()0%440100%
CameraMode_OnChange(...)0%330100%

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        {
 117            base.OnStepStart();
 18
 119            CommonScriptableObjects.cameraMode.OnChange += CameraMode_OnChange;
 120        }
 21
 22        public override void OnStepFinished()
 23        {
 124            base.OnStepFinished();
 25
 126            CommonScriptableObjects.cameraMode.OnChange -= CameraMode_OnChange;
 127        }
 28
 29        public override IEnumerator OnStepExecute()
 30        {
 431            yield return new WaitUntil(() => stepIsFinished);
 132            yield return new WaitForSeconds(0.5f);
 133            audioEventSuccess.Play(true);
 134        }
 35
 36        internal void CameraMode_OnChange(CameraMode.ModeId current, CameraMode.ModeId previous)
 37        {
 138            if (current != previous && mainSection.activeSelf)
 139                stepIsFinished = true;
 140        }
 41    }
 42}