| | 1 | | using DCL.Interface; |
| | 2 | | using System.Collections; |
| | 3 | | using TMPro; |
| | 4 | | using UnityEngine; |
| | 5 | | using UnityEngine.UI; |
| | 6 | |
|
| | 7 | | namespace DCL.Tutorial |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Class that represents the onboarding tutorial step related to the greetings showed in Genesis Plaza. |
| | 11 | | /// </summary> |
| | 12 | | public class TutorialStep_GenesisGreetings : TutorialStep |
| | 13 | | { |
| | 14 | | private const int TEACHER_CANVAS_SORT_ORDER_START = 4; |
| | 15 | |
|
| | 16 | | [SerializeField] |
| | 17 | | Button okButton; |
| | 18 | |
|
| | 19 | | [SerializeField] |
| | 20 | | TMP_Text titleText; |
| | 21 | |
|
| | 22 | | private bool stepIsFinished = false; |
| | 23 | | private int defaultTeacherCanvasSortOrder; |
| | 24 | |
|
| | 25 | | public override void OnStepStart() |
| | 26 | | { |
| 2 | 27 | | base.OnStepStart(); |
| | 28 | |
|
| 2 | 29 | | CommonScriptableObjects.featureKeyTriggersBlocked.Set(true); |
| | 30 | |
|
| 2 | 31 | | titleText.text = titleText.text.Replace("{userName}", UserProfile.GetOwnUserProfile().userName); |
| | 32 | |
|
| 2 | 33 | | okButton.onClick.AddListener(OnOkButtonClick); |
| | 34 | |
|
| 2 | 35 | | if (tutorialController != null) |
| | 36 | | { |
| 2 | 37 | | tutorialController.SetEagleEyeCameraActive(true); |
| | 38 | |
|
| 2 | 39 | | if (tutorialController.configuration.teacherCanvas != null) |
| 2 | 40 | | defaultTeacherCanvasSortOrder = tutorialController.configuration.teacherCanvas.sortingOrder; |
| | 41 | |
|
| 2 | 42 | | tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START); |
| | 43 | |
|
| 2 | 44 | | tutorialController.hudController?.taskbarHud?.SetVisibility(false); |
| | 45 | |
|
| 2 | 46 | | if (Environment.i != null && Environment.i.world != null) |
| | 47 | | { |
| 2 | 48 | | WebInterface.SendSceneExternalActionEvent(Environment.i.world.state.currentSceneId, "tutorial", "beg |
| | 49 | | } |
| | 50 | | } |
| 2 | 51 | | } |
| | 52 | |
|
| 10 | 53 | | public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => stepIsFinished); } |
| | 54 | |
|
| | 55 | | public override IEnumerator OnStepPlayHideAnimation() |
| | 56 | | { |
| 2 | 57 | | tutorialController?.SetEagleEyeCameraActive(false); |
| 2 | 58 | | yield return base.OnStepPlayHideAnimation(); |
| 2 | 59 | | } |
| | 60 | |
|
| | 61 | | public override void OnStepFinished() |
| | 62 | | { |
| 2 | 63 | | base.OnStepFinished(); |
| 2 | 64 | | tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder); |
| 2 | 65 | | } |
| | 66 | |
|
| 0 | 67 | | internal void OnOkButtonClick() { stepIsFinished = true; } |
| | 68 | | } |
| | 69 | | } |