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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%56700%
OnStepExecute()0%12300%
OnStepPlayHideAnimation()0%20400%
OnStepFinished()0%2100%
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        {
 027            base.OnStepStart();
 28
 029            CommonScriptableObjects.featureKeyTriggersBlocked.Set(true);
 30
 031            titleText.text = titleText.text.Replace("{userName}", UserProfile.GetOwnUserProfile().userName);
 32
 033            okButton.onClick.AddListener(OnOkButtonClick);
 34
 035            if (tutorialController)
 36            {
 037                tutorialController.SetEagleEyeCameraActive(true);
 38
 039                defaultTeacherCanvasSortOrder = tutorialController.teacherCanvas.sortingOrder;
 040                tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START);
 41
 042                tutorialController.hudController?.taskbarHud?.SetVisibility(false);
 043                tutorialController.hudController?.profileHud?.SetBackpackButtonVisibility(false);
 44
 045                if (Environment.i != null)
 46                {
 047                    WebInterface.SendSceneExternalActionEvent(Environment.i.world.state.currentSceneId, "tutorial", "beg
 48                }
 49            }
 050        }
 51
 052        public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => stepIsFinished); }
 53
 54        public override IEnumerator OnStepPlayHideAnimation()
 55        {
 056            tutorialController?.SetEagleEyeCameraActive(false);
 057            yield return base.OnStepPlayHideAnimation();
 058        }
 59
 60        public override void OnStepFinished()
 61        {
 062            base.OnStepFinished();
 063            tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder);
 064        }
 65
 066        private void OnOkButtonClick() { stepIsFinished = true; }
 67    }
 68}