| | 1 | | using System.Collections; |
| | 2 | | using DCL.CameraTool; |
| | 3 | | using UnityEngine; |
| | 4 | |
|
| | 5 | | namespace DCL.Tutorial |
| | 6 | | { |
| | 7 | | /// <summary> |
| | 8 | | /// Class that represents the onboarding tutorial step related to how to change the camera view. |
| | 9 | | /// </summary> |
| | 10 | | public class TutorialStep_Camera : TutorialStep |
| | 11 | | { |
| | 12 | | [SerializeField] AudioEvent audioEventSuccess; |
| | 13 | |
|
| | 14 | | private bool stepIsFinished = false; |
| | 15 | |
|
| | 16 | | public override void OnStepStart() |
| | 17 | | { |
| 0 | 18 | | base.OnStepStart(); |
| | 19 | |
|
| 0 | 20 | | CommonScriptableObjects.cameraMode.OnChange += CameraMode_OnChange; |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | public override void OnStepFinished() |
| | 24 | | { |
| 0 | 25 | | base.OnStepFinished(); |
| | 26 | |
|
| 0 | 27 | | CommonScriptableObjects.cameraMode.OnChange -= CameraMode_OnChange; |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | public override IEnumerator OnStepExecute() |
| | 31 | | { |
| 0 | 32 | | yield return new WaitUntil(() => stepIsFinished); |
| 0 | 33 | | yield return new WaitForSeconds(0.5f); |
| 0 | 34 | | audioEventSuccess.Play(true); |
| 0 | 35 | | } |
| | 36 | |
|
| | 37 | | internal void CameraMode_OnChange(CameraMode.ModeId current, CameraMode.ModeId previous) |
| | 38 | | { |
| 0 | 39 | | if (current != previous && mainSection.activeSelf) |
| 0 | 40 | | stepIsFinished = true; |
| 0 | 41 | | } |
| | 42 | | } |
| | 43 | | } |