< 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:43
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 DCL.CameraTool;
 3using UnityEngine;
 4
 5namespace DCL.Tutorial
 6{
 7    /// <summary>
 8    /// Class that represents the onboarding tutorial step related to how to change the camera view.
 9    /// </summary>
 10    public class TutorialStep_Camera : TutorialStep
 11    {
 12        [SerializeField] AudioEvent audioEventSuccess;
 13
 14        private bool stepIsFinished = false;
 15
 16        public override void OnStepStart()
 17        {
 018            base.OnStepStart();
 19
 020            CommonScriptableObjects.cameraMode.OnChange += CameraMode_OnChange;
 021        }
 22
 23        public override void OnStepFinished()
 24        {
 025            base.OnStepFinished();
 26
 027            CommonScriptableObjects.cameraMode.OnChange -= CameraMode_OnChange;
 028        }
 29
 30        public override IEnumerator OnStepExecute()
 31        {
 032            yield return new WaitUntil(() => stepIsFinished);
 033            yield return new WaitForSeconds(0.5f);
 034            audioEventSuccess.Play(true);
 035        }
 36
 37        internal void CameraMode_OnChange(CameraMode.ModeId current, CameraMode.ModeId previous)
 38        {
 039            if (current != previous && mainSection.activeSelf)
 040                stepIsFinished = true;
 041        }
 42    }
 43}