< Summary

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

Metrics

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

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using UnityEngine;
 3using UnityEngine.UI;
 4
 5namespace DCL.Tutorial
 6{
 7    /// <summary>
 8    /// Class that represents the onboarding tutorial step related to the very basic controls.
 9    /// </summary>
 10    public class TutorialStep_BasicControls : TutorialStep
 11    {
 12        private const int TEACHER_CANVAS_SORT_ORDER_START = 4;
 13
 14        [SerializeField] AudioEvent audioEventSuccess;
 15        [SerializeField] Button okButton;
 16
 17        internal bool stepIsFinished = false;
 18        private int defaultTeacherCanvasSortOrder;
 19
 20        public override void OnStepStart()
 21        {
 022            base.OnStepStart();
 23
 024            CommonScriptableObjects.featureKeyTriggersBlocked.Set(true);
 25
 026            okButton.onClick.AddListener(OnOkButtonClick);
 27
 028            if (tutorialController.configuration.teacherCanvas != null)
 029                defaultTeacherCanvasSortOrder = tutorialController.configuration.teacherCanvas.sortingOrder;
 30
 031            tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START);
 32
 033            tutorialController.hudController?.taskbarHud?.SetVisibility(false);
 034        }
 35
 36        public override IEnumerator OnStepExecute()
 37        {
 038            yield return new WaitUntil(() => stepIsFinished);
 039            audioEventSuccess.Play(true);
 040        }
 41
 42        public override void OnStepFinished()
 43        {
 044            base.OnStepFinished();
 045            tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder);
 046            tutorialController.hudController?.taskbarHud?.SetVisibility(true);
 047            CommonScriptableObjects.featureKeyTriggersBlocked.Set(false);
 048        }
 49
 050        internal void OnOkButtonClick() { stepIsFinished = true; }
 51    }
 52}