< 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:1
Uncovered lines:6
Coverable lines:7
Total lines:31
Line coverage:14.2% (1 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%20400%
OnStepExecute()0%12300%

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;
 114        [SerializeField] internal float minRunningTime = 2f;
 15
 16        internal float timeRunning = 0f;
 17
 18        private void Update()
 19        {
 020            if ((playerXAxisInpuAction.GetValue() != 0f || playerYAxisInputAction.GetValue() != 0f) &&
 21                mainSection.activeSelf)
 022                timeRunning += Time.deltaTime;
 023        }
 24
 25        public override IEnumerator OnStepExecute()
 26        {
 027            yield return new WaitUntil(() => timeRunning >= minRunningTime);
 028            audioEventSuccess.Play(true);
 029        }
 30    }
 31}