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

Metrics

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

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        {
 019            base.OnStepStart();
 20
 021            modal.SetActive(true);
 22
 023            okButton.onClick.AddListener(() =>
 24            {
 025                modal.SetActive(false);
 026                stepAnimator.SetTrigger("OkPressed");
 027                okPressed = true;
 028            });
 029        }
 30
 31        public override IEnumerator OnStepExecute()
 32        {
 033            yield return new WaitUntil(() => okPressed);
 034            audioEventSuccess.Play(true);
 035        }
 36
 37        public override void OnStepFinished()
 38        {
 039            base.OnStepFinished();
 040            okButton.onClick.RemoveAllListeners();
 041        }
 42    }
 43}