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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%30500%
OnStepExecute()0%12300%
OnStepFinished()0%30500%
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        private 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            defaultTeacherCanvasSortOrder = tutorialController.teacherCanvas.sortingOrder;
 029            tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START);
 30
 031            tutorialController.hudController?.taskbarHud?.SetVisibility(false);
 032            tutorialController.hudController?.profileHud?.SetBackpackButtonVisibility(false);
 033        }
 34
 35        public override IEnumerator OnStepExecute()
 36        {
 037            yield return new WaitUntil(() => stepIsFinished);
 038            audioEventSuccess.Play(true);
 039        }
 40
 41        public override void OnStepFinished()
 42        {
 043            base.OnStepFinished();
 044            tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder);
 045            tutorialController.hudController?.taskbarHud?.SetVisibility(true);
 046            tutorialController.hudController?.profileHud?.SetBackpackButtonVisibility(true);
 047            CommonScriptableObjects.featureKeyTriggersBlocked.Set(false);
 048        }
 49
 050        private void OnOkButtonClick() { stepIsFinished = true; }
 51    }
 52}