< Summary

Class:DCL.Tutorial.TutorialStep_AvatarMovement
Assembly:Onboarding
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Tutorial/Scripts/Steps/Initial/TutorialStep_AvatarMovement.cs
Covered lines:6
Uncovered lines:1
Coverable lines:7
Total lines:31
Line coverage:85.7% (6 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
TutorialStep_AvatarMovement()0%110100%
Update()0%4.594066.67%
OnStepExecute()0%330100%

File(s)

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

#LineLine coverage
 1using System.Collections;
 2using UnityEngine;
 3
 4namespace DCL.Tutorial
 5{
 6    /// <summary>
 7    /// Class that represents the onboarding tutorial step related to how to run with the avatar.
 8    /// </summary>
 9    public class TutorialStep_AvatarMovement : TutorialStep
 10    {
 11        [SerializeField] AudioEvent audioEventSuccess;
 12        [SerializeField] InputAction_Measurable playerXAxisInpuAction;
 13        [SerializeField] InputAction_Measurable playerYAxisInputAction;
 214        [SerializeField] internal float minRunningTime = 2f;
 15
 16        internal float timeRunning = 0f;
 17
 18        private void Update()
 19        {
 520            if ((playerXAxisInpuAction.GetValue() != 0f || playerYAxisInputAction.GetValue() != 0f) &&
 21                mainSection.activeSelf)
 022                timeRunning += Time.deltaTime;
 523        }
 24
 25        public override IEnumerator OnStepExecute()
 26        {
 427            yield return new WaitUntil(() => timeRunning >= minRunningTime);
 128            audioEventSuccess.Play(true);
 129        }
 30    }
 31}