| | 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 | | { |
| 0 | 27 | | base.OnStepStart(); |
| | 28 | |
|
| 0 | 29 | | CommonScriptableObjects.featureKeyTriggersBlocked.Set(true); |
| | 30 | |
|
| 0 | 31 | | titleText.text = titleText.text.Replace("{userName}", UserProfile.GetOwnUserProfile().userName); |
| | 32 | |
|
| 0 | 33 | | okButton.onClick.AddListener(OnOkButtonClick); |
| | 34 | |
|
| 0 | 35 | | if (tutorialController) |
| | 36 | | { |
| 0 | 37 | | tutorialController.SetEagleEyeCameraActive(true); |
| | 38 | |
|
| 0 | 39 | | defaultTeacherCanvasSortOrder = tutorialController.teacherCanvas.sortingOrder; |
| 0 | 40 | | tutorialController.SetTeacherCanvasSortingOrder(TEACHER_CANVAS_SORT_ORDER_START); |
| | 41 | |
|
| 0 | 42 | | tutorialController.hudController?.taskbarHud?.SetVisibility(false); |
| 0 | 43 | | tutorialController.hudController?.profileHud?.SetBackpackButtonVisibility(false); |
| | 44 | |
|
| 0 | 45 | | if (Environment.i != null) |
| | 46 | | { |
| 0 | 47 | | WebInterface.SendSceneExternalActionEvent(Environment.i.world.state.currentSceneId, "tutorial", "beg |
| | 48 | | } |
| | 49 | | } |
| 0 | 50 | | } |
| | 51 | |
|
| 0 | 52 | | public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => stepIsFinished); } |
| | 53 | |
|
| | 54 | | public override IEnumerator OnStepPlayHideAnimation() |
| | 55 | | { |
| 0 | 56 | | tutorialController?.SetEagleEyeCameraActive(false); |
| 0 | 57 | | yield return base.OnStepPlayHideAnimation(); |
| 0 | 58 | | } |
| | 59 | |
|
| | 60 | | public override void OnStepFinished() |
| | 61 | | { |
| 0 | 62 | | base.OnStepFinished(); |
| 0 | 63 | | tutorialController.SetTeacherCanvasSortingOrder(defaultTeacherCanvasSortOrder); |
| 0 | 64 | | } |
| | 65 | |
|
| 0 | 66 | | private void OnOkButtonClick() { stepIsFinished = true; } |
| | 67 | | } |
| | 68 | | } |