| | 1 | | using System.Collections; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace 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; |
| 2 | 14 | | [SerializeField] internal float minRunningTime = 2f; |
| | 15 | |
|
| | 16 | | internal float timeRunning = 0f; |
| | 17 | |
|
| | 18 | | private void Update() |
| | 19 | | { |
| 5 | 20 | | if ((playerXAxisInpuAction.GetValue() != 0f || playerYAxisInputAction.GetValue() != 0f) && |
| | 21 | | mainSection.activeSelf) |
| 0 | 22 | | timeRunning += Time.deltaTime; |
| 5 | 23 | | } |
| | 24 | |
|
| | 25 | | public override IEnumerator OnStepExecute() |
| | 26 | | { |
| 4 | 27 | | yield return new WaitUntil(() => timeRunning >= minRunningTime); |
| 1 | 28 | | audioEventSuccess.Play(true); |
| 1 | 29 | | } |
| | 30 | | } |
| | 31 | | } |