| | 1 | | using System.Collections; |
| | 2 | |
|
| | 3 | | namespace DCL.Tutorial |
| | 4 | | { |
| | 5 | | /// <summary> |
| | 6 | | /// Class that represents the onboarding tutorial step related to how to lock/unlock the cursor. |
| | 7 | | /// </summary> |
| | 8 | | public class TutorialStep_LockTheCursor : TutorialStep |
| | 9 | | { |
| | 10 | | public override void OnStepStart() |
| | 11 | | { |
| 0 | 12 | | base.OnStepStart(); |
| | 13 | |
|
| 0 | 14 | | if (tutorialController == null) |
| 0 | 15 | | return; |
| | 16 | |
|
| 0 | 17 | | CommonScriptableObjects.featureKeyTriggersBlocked.Set(true); |
| 0 | 18 | | if (tutorialController.currentPath == TutorialController.TutorialPath.FromGenesisPlaza) |
| | 19 | | { |
| 0 | 20 | | tutorialController.ShowTeacher3DModel(true); |
| 0 | 21 | | tutorialController.SetTeacherPosition(teacherPositionRef.position); |
| 0 | 22 | | if (tutorialController.configuration.teacher != null && |
| | 23 | | tutorialController.configuration.teacher.IsHiddenByAnimation) |
| 0 | 24 | | tutorialController.configuration.teacher.PlayAnimation(TutorialTeacher.TeacherAnimation.Reset); |
| 0 | 25 | | } |
| | 26 | | else |
| | 27 | | { |
| 0 | 28 | | tutorialController.hudController?.taskbarHud?.SetVisibility(false); |
| 0 | 29 | | tutorialController.ShowTeacher3DModel(false); |
| 0 | 30 | | OnShowAnimationFinished += SetupAlicePosition; |
| | 31 | | } |
| 0 | 32 | | } |
| | 33 | |
|
| | 34 | | private void SetupAlicePosition() |
| | 35 | | { |
| 0 | 36 | | if (tutorialController != null) |
| | 37 | | { |
| 0 | 38 | | tutorialController.SetTeacherPosition(teacherPositionRef.position, false); |
| 0 | 39 | | tutorialController.ShowTeacher3DModel(true); |
| 0 | 40 | | tutorialController.configuration?.teacher?.PlayAnimation(TutorialTeacher.TeacherAnimation.Reset); |
| | 41 | | } |
| 0 | 42 | | OnShowAnimationFinished -= SetupAlicePosition; |
| 0 | 43 | | } |
| | 44 | |
|
| 0 | 45 | | public override IEnumerator OnStepExecute() { yield return new WaitUntil(() => mouseCatcher == null || mouseCatc |
| | 46 | | } |
| | 47 | | } |