| | 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 change the camera view. |
| | 8 | | /// </summary> |
| | 9 | | public class TutorialStep_Camera : TutorialStep |
| | 10 | | { |
| | 11 | | [SerializeField] AudioEvent audioEventSuccess; |
| | 12 | |
|
| | 13 | | private bool stepIsFinished = false; |
| | 14 | |
|
| | 15 | | public override void OnStepStart() |
| | 16 | | { |
| 1 | 17 | | base.OnStepStart(); |
| | 18 | |
|
| 1 | 19 | | CommonScriptableObjects.cameraMode.OnChange += CameraMode_OnChange; |
| 1 | 20 | | } |
| | 21 | |
|
| | 22 | | public override void OnStepFinished() |
| | 23 | | { |
| 1 | 24 | | base.OnStepFinished(); |
| | 25 | |
|
| 1 | 26 | | CommonScriptableObjects.cameraMode.OnChange -= CameraMode_OnChange; |
| 1 | 27 | | } |
| | 28 | |
|
| | 29 | | public override IEnumerator OnStepExecute() |
| | 30 | | { |
| 4 | 31 | | yield return new WaitUntil(() => stepIsFinished); |
| 1 | 32 | | yield return new WaitForSeconds(0.5f); |
| 1 | 33 | | audioEventSuccess.Play(true); |
| 1 | 34 | | } |
| | 35 | |
|
| | 36 | | internal void CameraMode_OnChange(CameraMode.ModeId current, CameraMode.ModeId previous) |
| | 37 | | { |
| 1 | 38 | | if (current != previous && mainSection.activeSelf) |
| 1 | 39 | | stepIsFinished = true; |
| 1 | 40 | | } |
| | 41 | | } |
| | 42 | | } |