< Summary

Class:DCL.Tutorial.TutorialStep_TutorialCompleted
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_TutorialCompleted.cs
Covered lines:10
Uncovered lines:4
Coverable lines:14
Total lines:43
Line coverage:71.4% (10 of 14)
Covered branches:0
Total branches:0

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_TutorialCompleted.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 the end of the tutorial.
 8    /// </summary>
 9    public class TutorialStep_TutorialCompleted : TutorialStep
 10    {
 11        [SerializeField] AudioEvent audioEventSuccess;
 12        [SerializeField] ButtonComponentView okButton;
 13        [SerializeField] GameObject modal;
 14
 15        internal bool okPressed = false;
 16
 17        public override void OnStepStart()
 18        {
 119            base.OnStepStart();
 20
 121            modal.SetActive(true);
 22
 123            okButton.onClick.AddListener(() =>
 24            {
 025                modal.SetActive(false);
 026                stepAnimator.SetTrigger("OkPressed");
 027                okPressed = true;
 028            });
 129        }
 30
 31        public override IEnumerator OnStepExecute()
 32        {
 433            yield return new WaitUntil(() => okPressed);
 134            audioEventSuccess.Play(true);
 135        }
 36
 37        public override void OnStepFinished()
 38        {
 139            base.OnStepFinished();
 140            okButton.onClick.RemoveAllListeners();
 141        }
 42    }
 43}