< 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:69
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 != null)
 36            {
 037                tutorialController.SetEagleEyeCameraActive(true);
 38
 039                if (tutorialController.configuration.teacherCanvas != null)
 040                    defaultTeacherCanvasSortOrder = tutorialController.configuration.teacherCanvas.sortingOrder;
 41
 042                tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START);
 43
 044                tutorialController.hudController?.taskbarHud?.SetVisibility(false);
 45
 046                if (Environment.i != null && Environment.i.world != null)
 47                {
 048                    WebInterface.SendSceneExternalActionEvent(Environment.i.world.state.GetCurrentSceneId(), "tutorial",
 49                }
 50            }
 051        }
 52
 053        public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => stepIsFinished); }
 54
 55        public override IEnumerator OnStepPlayHideAnimation()
 56        {
 057            tutorialController?.SetEagleEyeCameraActive(false);
 058            yield return base.OnStepPlayHideAnimation();
 059        }
 60
 61        public override void OnStepFinished()
 62        {
 063            base.OnStepFinished();
 064            tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder);
 065        }
 66
 067        internal void OnOkButtonClick() { stepIsFinished = true; }
 68    }
 69}