| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using UnityEngine; |
| | 4 | | using DCL.Tutorial; |
| | 5 | |
|
| | 6 | | public class TutorialStep_PutSceneObject : TutorialStep |
| | 7 | | { |
| | 8 | | [SerializeField] AudioEvent audioEventSuccess; |
| | 9 | | bool sceneObjectSet = false; |
| | 10 | |
|
| | 11 | | BIWCreatorController builderInWorldController; |
| | 12 | |
|
| | 13 | | public override void OnStepStart() |
| | 14 | | { |
| 0 | 15 | | base.OnStepStart(); |
| 0 | 16 | | builderInWorldController = FindObjectOfType<BIWCreatorController>(); |
| 0 | 17 | | builderInWorldController.OnCatalogItemPlaced += SceneObjectSelected; |
| 0 | 18 | | } |
| | 19 | |
|
| | 20 | | public override void OnStepFinished() |
| | 21 | | { |
| 0 | 22 | | base.OnStepFinished(); |
| | 23 | |
|
| 0 | 24 | | builderInWorldController.OnCatalogItemPlaced -= SceneObjectSelected; |
| 0 | 25 | | } |
| | 26 | |
|
| 0 | 27 | | void SceneObjectSelected() { sceneObjectSet = true; } |
| | 28 | |
|
| | 29 | | public override IEnumerator OnStepExecute() |
| | 30 | | { |
| 0 | 31 | | yield return new WaitUntil(() => sceneObjectSet); |
| 0 | 32 | | audioEventSuccess.Play(true); |
| 0 | 33 | | } |
| | 34 | | } |