| | 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 the end of the tutorial. |
| | 8 | | /// </summary> |
| | 9 | | public class TutorialStep_TutorialCompleted : TutorialStep |
| | 10 | | { |
| | 11 | | [SerializeField] AudioEvent audioEventSuccess; |
| | 12 | | [SerializeField] ButtonComponentView okButton; |
| | 13 | | [SerializeField] GameObject modal; |
| | 14 | |
|
| | 15 | | internal bool okPressed = false; |
| | 16 | |
|
| | 17 | | public override void OnStepStart() |
| | 18 | | { |
| 1 | 19 | | base.OnStepStart(); |
| | 20 | |
|
| 1 | 21 | | modal.SetActive(true); |
| | 22 | |
|
| 1 | 23 | | okButton.onClick.AddListener(() => |
| | 24 | | { |
| 0 | 25 | | modal.SetActive(false); |
| 0 | 26 | | stepAnimator.SetTrigger("OkPressed"); |
| 0 | 27 | | okPressed = true; |
| 0 | 28 | | }); |
| 1 | 29 | | } |
| | 30 | |
|
| | 31 | | public override IEnumerator OnStepExecute() |
| | 32 | | { |
| 4 | 33 | | yield return new WaitUntil(() => okPressed); |
| 1 | 34 | | audioEventSuccess.Play(true); |
| 1 | 35 | | } |
| | 36 | |
|
| | 37 | | public override void OnStepFinished() |
| | 38 | | { |
| 1 | 39 | | base.OnStepFinished(); |
| 1 | 40 | | okButton.onClick.RemoveAllListeners(); |
| 1 | 41 | | } |
| | 42 | | } |
| | 43 | | } |