< Summary

Class:DCL.Tutorial.TutorialStep_GenesisGreetings
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_GenesisGreetings.cs
Covered lines:20
Uncovered lines:1
Coverable lines:21
Total lines:69
Line coverage:95.2% (20 of 21)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%770100%
OnStepExecute()0%330100%
OnStepPlayHideAnimation()0%440100%
OnStepFinished()0%110100%
OnOkButtonClick()0%2100%

File(s)

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

#LineLine coverage
 1using DCL.Interface;
 2using System.Collections;
 3using TMPro;
 4using UnityEngine;
 5using UnityEngine.UI;
 6
 7namespace DCL.Tutorial
 8{
 9    /// <summary>
 10    /// Class that represents the onboarding tutorial step related to the greetings showed in Genesis Plaza.
 11    /// </summary>
 12    public class TutorialStep_GenesisGreetings : TutorialStep
 13    {
 14        private const int TEACHER_CANVAS_SORT_ORDER_START = 4;
 15
 16        [SerializeField]
 17        Button okButton;
 18
 19        [SerializeField]
 20        TMP_Text titleText;
 21
 22        private bool stepIsFinished = false;
 23        private int defaultTeacherCanvasSortOrder;
 24
 25        public override void OnStepStart()
 26        {
 227            base.OnStepStart();
 28
 229            CommonScriptableObjects.featureKeyTriggersBlocked.Set(true);
 30
 231            titleText.text = titleText.text.Replace("{userName}", UserProfile.GetOwnUserProfile().userName);
 32
 233            okButton.onClick.AddListener(OnOkButtonClick);
 34
 235            if (tutorialController != null)
 36            {
 237                tutorialController.SetEagleEyeCameraActive(true);
 38
 239                if (tutorialController.configuration.teacherCanvas != null)
 240                    defaultTeacherCanvasSortOrder = tutorialController.configuration.teacherCanvas.sortingOrder;
 41
 242                tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START);
 43
 244                tutorialController.hudController?.taskbarHud?.SetVisibility(false);
 45
 246                if (Environment.i != null && Environment.i.world != null)
 47                {
 248                    WebInterface.SendSceneExternalActionEvent(Environment.i.world.state.currentSceneId, "tutorial", "beg
 49                }
 50            }
 251        }
 52
 1053        public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => stepIsFinished); }
 54
 55        public override IEnumerator OnStepPlayHideAnimation()
 56        {
 257            tutorialController?.SetEagleEyeCameraActive(false);
 258            yield return base.OnStepPlayHideAnimation();
 259        }
 60
 61        public override void OnStepFinished()
 62        {
 263            base.OnStepFinished();
 264            tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder);
 265        }
 66
 067        internal void OnOkButtonClick() { stepIsFinished = true; }
 68    }
 69}