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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnStepStart()0%990100%
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);
 245                tutorialController.hudController?.profileHud?.SetBackpackButtonVisibility(false);
 46
 247                if (Environment.i != null && Environment.i.world != null)
 48                {
 249                    WebInterface.SendSceneExternalActionEvent(Environment.i.world.state.currentSceneId, "tutorial", "beg
 50                }
 51            }
 252        }
 53
 1054        public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => stepIsFinished); }
 55
 56        public override IEnumerator OnStepPlayHideAnimation()
 57        {
 258            tutorialController?.SetEagleEyeCameraActive(false);
 259            yield return base.OnStepPlayHideAnimation();
 260        }
 61
 62        public override void OnStepFinished()
 63        {
 264            base.OnStepFinished();
 265            tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder);
 266        }
 67
 068        internal void OnOkButtonClick() { stepIsFinished = true; }
 69    }
 70}