void setWayPoints() { gameObject.SetActive(true); wayPoints = new List <Vector3> (); //construct the path waypoints: pathsToFollow[currentPath].SetActive(true); //numbersToShow [currentPath].SetActive (true); linesToShow [currentPath].SetActive(true); foreach (Transform child in pathsToFollow[currentPath].transform) { wayPoints.Add(child.transform.position); } startingPosition = wayPoints[0]; currentWayPoint = 0; isShownOnce = true; MazeGameManager.instance.timer.StartTimer(); if (wayPoints.Count == 1) { TutorialUI.ClickRepeat(wayPoints[0]); } else { TutorialUI.DrawLine(wayPoints.ToArray(), TutorialUI.DrawLineMode.FingerAndArrow, false, true); } }
void Update_Click() { if (!Input.GetMouseButtonUp(0)) { return; } switch (drawMode) { case DrawMode.Click: TutorialUI.Click(MouseWorldPosition()); break; case DrawMode.ClickRepeat: TutorialUI.ClickRepeat(MouseWorldPosition()); break; case DrawMode.RandomMark: TutorialUI.MarkSize markSize = NormalToggle.isOn ? TutorialUI.MarkSize.Normal : BigToggle.isOn ? TutorialUI.MarkSize.Big : TutorialUI.MarkSize.Huge; if (UnityEngine.Random.value < 0.5f) { TutorialUI.MarkYes(MouseWorldPosition(), markSize); } else { TutorialUI.MarkNo(MouseWorldPosition(), markSize); } break; } }
void ShowFinger() { Vector3 offset = new Vector3(0f, 3f, -1.5f); Vector3 offsetCentral = new Vector3(0f, 3f, -2f); Vector3 offsetFirst = new Vector3(0.5f, 3f, -2f); switch (phase) { case 0: TutorialUI.ClickRepeat(ArrayTrees[0].transform.position + offsetFirst, animDuration, 1); break; case 1: TutorialUI.ClickRepeat(ArrayLetters[0].transform.position + offset, animDuration, 1); break; case 2: TutorialUI.ClickRepeat(ArrayTrees[1].transform.position + offsetCentral, animDuration, 1); break; case 3: TutorialUI.ClickRepeat(ArrayLetters[1].transform.position + offset, animDuration, 1); break; } timeFinger = Time.time + animDuration + timeToWait; }
public void Update(float delta) { m_fDelayTime -= delta; if (m_fDelayTime < 0 && !m_bSuggested) { KeeperManager.I.PlayDialogue(MissingLetterConfiguration.Instance.TutorialLocalizationId); m_oGame.m_oRoundManager.GetCorrectLLObject().GetComponent <LetterBehaviour>().PlayAnimation(LLAnimationStates.LL_dancing); Vector3 pos = m_oGame.m_oRoundManager.GetCorrectLLObject().transform.position + Vector3.back * 0.8f + Vector3.up * 3; TutorialUI.ClickRepeat(pos, 90, 1.5f); m_bSuggested = true; } }
private void StepTutorialExit() { CurrentRunningPhase = FirstContactPhase.AnturaSpace_Exit; TutorialUI.Clear(false); AudioManager.I.StopDialogue(false); _mScene.ShowBackButton(); Dialogue(LocalizationDataId.AnturaSpace_Exit); TutorialUI.ClickRepeat( Vector3.down * 0.025f + m_oCameraUI.ScreenToWorldPoint(new Vector3(GlobalUI.I.BackButton.RectT.position.x, GlobalUI.I.BackButton.RectT.position.y, m_oCameraUI.nearClipPlane)), float.MaxValue, 1); }
public void Update(float delta) { m_fDelayTime -= delta; if (m_fDelayTime < 0 && !m_bSuggested) { if (MissingLetterConfiguration.Instance.Variation == MissingLetterVariation.MissingLetter) { AudioManager.I.PlayDialog(Db.LocalizationDataId.MissingLetter_Tuto); } else { AudioManager.I.PlayDialog(Db.LocalizationDataId.MissingLetter_phrases_Tuto); } m_oGame.m_oRoundManager.GetCorrectLLObject().GetComponent <LetterBehaviour>().PlayAnimation(LLAnimationStates.LL_dancing); Vector3 pos = m_oGame.m_oRoundManager.GetCorrectLLObject().transform.position + Vector3.back * 0.8f + Vector3.up * 3; TutorialUI.ClickRepeat(pos, 90, 1.5f); m_bSuggested = true; } }
void ShowTutorialPressCorrect() { tutorialCorrectActive = true; tutorialSequenceIndex = letterOnSequence; if (isSequence) { tutorialCorrectTimer = 1f; Vector3 clickPosition = game.eggButtonBox.GetButtons(false)[tutorialSequenceIndex].transform.position; TutorialUI.Click(clickPosition); } else { tutorialCorrectTimer = 2f; Vector3 clickPosition = game.eggButtonBox.GetButtons(false)[tutorialSequenceIndex].transform.position; TutorialUI.ClickRepeat(clickPosition, tutorialCorrectTimer); } }
private void StepTutorialTouchAntura() { CurrentRunningPhase = FirstContactPhase.AnturaSpace_TouchAntura; // Push the player to touch Antura TutorialUI.Clear(false); // Reset antura as sleeping _mScene.Antura.transform.position = _mScene.SceneCenter.position; _mScene.Antura.AnimationController.State = AnturaAnimationStates.sleeping; _mScene.CurrentState = _mScene.Sleeping; m_oAnturaBehaviour.onTouched += HandleAnturaTouched; Vector3 clickOffset = m_oAnturaBehaviour.IsSleeping ? Vector3.down * 2 : Vector3.zero; TutorialUI.ClickRepeat(m_oAnturaBehaviour.gameObject.transform.position + clickOffset + Vector3.forward * -2 + Vector3.up, float.MaxValue, 1); Dialogue(LocalizationDataId.AnturaSpace_Intro); }
private void StepTutorialPhoto() { CurrentRunningPhase = FirstContactPhase.AnturaSpace_Photo; if (_currentPhotoStep < PhotoTutorialStep.FINISH) { _currentPhotoStep += 1; } TutorialUI.Clear(false); //Debug.Log("CURRENT STEP IS " + _currentPhotoStep); // Hide other UIs SetPhaseUIShown(FirstContactPhase.AnturaSpace_Customization, false); SetPhaseUIShown(FirstContactPhase.AnturaSpace_Exit, false); ShopActionUI photoActionUI; switch (_currentPhotoStep) { case PhotoTutorialStep.CLICK_PHOTO: DialogueThen(LocalizationDataId.AnturaSpace_Photo_Intro, () => { // We need to find the shop action photo UI which is attached with the ShopAction_Photo photoActionUI = photoAction.GetComponent <ShopActionUI>(); CurrentTutorialFocus = photoActionUI; // Makes sure you have enough bones var photoCost = photoAction.bonesCost; AppManager.I.Player.AddBones(photoCost); // Focus on the photo button m_oPhotoButton.gameObject.SetActive(true); m_oPhotoButton.onClick.AddListener(StepTutorialPhoto); TutorialUI.ClickRepeat(m_oPhotoButton.transform.position, float.MaxValue, 1); Dialogue(LocalizationDataId.AnturaSpace_Photo_Take); }); break; case PhotoTutorialStep.CONFIRM_PHOTO: CurrentTutorialFocus = m_oCookieButton; // HACK: focus is actually photo action, but the shop has no reference to it, so we re-use the shop button instead // Cleanup last step m_oPhotoButton.onClick.RemoveListener(StepTutorialPhoto); // New step ShopPhotoManager.I.OnPurchaseCompleted += StepTutorialPhoto; var yesButton = UI.ShopPanelUI.confirmationYesButton; StartCoroutine(DelayedCallbackCO(() => { TutorialUI.ClickRepeat(yesButton.transform.position, float.MaxValue, 1); })); Dialogue( LocalizationDataId.AnturaSpace_Shop_ConfirmBuy ); break; case PhotoTutorialStep.FINISH: // Cleanup last step ShopPhotoManager.I.OnPurchaseCompleted -= StepTutorialPhoto; // New step _mScene.ShowBackButton(); Dialogue(LocalizationDataId.AnturaSpace_Photo_Gallery); CompleteTutorialPhase(); CurrentTutorialFocus = null; break; } }
private void StepTutorialShop() { CurrentRunningPhase = FirstContactPhase.AnturaSpace_Shop; if (_currentShopStep < ShopTutorialStep.FINISH) { _currentShopStep += 1; } TutorialUI.Clear(false); AudioManager.I.StopDialogue(false); // Hide other UIs SetPhaseUIShown(FirstContactPhase.AnturaSpace_Customization, false); SetPhaseUIShown(FirstContactPhase.AnturaSpace_Exit, false); ShopActionUI actionUI; Button yesButton; switch (_currentShopStep) { case ShopTutorialStep.ENTER_SHOP: // Start from a clean state AppManager.I.Player.MakeSureHasEnoughBones(20); ShopDecorationsManager.I.DeleteAllDecorations(); // Dialog -> Appear button DialogueThen( LocalizationDataId.AnturaSpace_Shop_Intro, () => { ShopDecorationsManager.SetContextClosed(); UI.ShowShopButton(true); m_oCookieButton.onClick.AddListener(StepTutorialShop); TutorialUI.ClickRepeat(m_oCookieButton.transform.position, float.MaxValue, 1); Dialogue(LocalizationDataId.AnturaSpace_Shop_Open); CurrentTutorialFocus = m_oCookieButton; } ); break; case ShopTutorialStep.DRAG_BONE: // Clean last step m_oCookieButton.onClick.RemoveListener(StepTutorialShop); // New step Dialogue(LocalizationDataId.AnturaSpace_Shop_Cookie); actionUI = UI.ShopPanelUI.GetActionUIByName("ShopAction_Bone"); _mScene.onEatObject += StepTutorialShop; CurrentTutorialFocus = actionUI; // Start drag line StartCoroutine(DelayedCallbackCO( () => { StartDrawDragLineFrom(actionUI.transform); }, 1.5f )); // Stop dragging as soon as we get a bone actionUI.ShopAction.OnActionCommitted += StopDrawDragLine; break; case ShopTutorialStep.PLACE_NEW_DECORATION: // Cleanup last step StopDrawDragLine(); actionUI = UI.ShopPanelUI.GetActionUIByName("ShopAction_Bone"); actionUI.ShopAction.OnActionCommitted -= StopDrawDragLine; _mScene.onEatObject -= StepTutorialShop; DialogueThen(LocalizationDataId.AnturaSpace_Intro_Cookie, () => { Dialogue(LocalizationDataId.AnturaSpace_Shop_BuyItem); // New step var leftmostUnassignedSlot = ShopDecorationsManager.GetDecorationSlots() .Where(x => !x.Assigned && x.slotType == ShopDecorationSlotType.Prop) .MinBy(x => x.transform.position.x); actionUI = UI.ShopPanelUI.GetActionUIByName("ShopAction_Decoration_Prop2"); StartDrawDragLineFromTo(actionUI.transform, leftmostUnassignedSlot.transform); ShopDecorationsManager.OnPurchaseConfirmationRequested += StepTutorialShop; CurrentTutorialFocus = actionUI; } ); break; case ShopTutorialStep.CONFIRM_BUY_DECORATION: // Cleanup last step StopDrawDragLine(); ShopDecorationsManager.OnPurchaseConfirmationRequested -= StepTutorialShop; // New step ShopDecorationsManager.OnPurchaseComplete += StepTutorialShop; yesButton = UI.ShopPanelUI.confirmationYesButton; CurrentTutorialFocus = yesButton; DialogueThen( LocalizationDataId.AnturaSpace_Shop_ConfirmBuy, () => { TutorialUI.ClickRepeat(yesButton.transform.position, float.MaxValue, 1); } ); break; case ShopTutorialStep.MOVE_DECORATION: // Cleanup last step ShopDecorationsManager.OnPurchaseComplete -= StepTutorialShop; // New step // Slot we assigned var assignedSlot = ShopDecorationsManager.GetDecorationSlots().FirstOrDefault(x => x.Assigned && x.slotType == ShopDecorationSlotType.Prop); var rightmostUnassignedSlot = ShopDecorationsManager.GetDecorationSlots() .Where(x => !x.Assigned && x.slotType == ShopDecorationSlotType.Prop) .MaxBy(x => x.transform.position.x); StartDrawDragLineFromTo(assignedSlot.transform, rightmostUnassignedSlot.transform, Vector3.up * 2f); ShopDecorationsManager.OnDragStop += StepTutorialShop; DialogueThen( LocalizationDataId.AnturaSpace_Shop_MoveItem, () => { } ); break; case ShopTutorialStep.EXIT_SHOP: // Cleanup last step ShopDecorationsManager.OnDragStop -= StepTutorialShop; StopDrawDragLine(); yesButton = UI.ShopPanelUI.confirmationYesButton; yesButton.onClick.RemoveListener(StepTutorialShop); // New step DialogueThen( LocalizationDataId.AnturaSpace_Shop_Close, () => { m_oCookieButton.onClick.AddListener(StepTutorialShop); TutorialUI.ClickRepeat(m_oCookieButton.transform.position, float.MaxValue, 1); CurrentTutorialFocus = m_oCookieButton; } ); break; case ShopTutorialStep.FINISH: // Cleanup last step m_oCookieButton.onClick.RemoveListener(StepTutorialShop); // New step _mScene.ShowBackButton(); Dialogue(LocalizationDataId.AnturaSpace_PlayAndExit); CurrentTutorialFocus = null; CompleteTutorialPhase(); break; } }
private void StepTutorialCustomization() { CurrentRunningPhase = FirstContactPhase.AnturaSpace_Customization; if (_currentCustomizationStep < CustomizationTutorialStep.FINISH) { _currentCustomizationStep += 1; } //Debug.Log("CURRENT STEP IS " + _currentCustomizationStep); TutorialUI.Clear(false); switch (_currentCustomizationStep) { case CustomizationTutorialStep.OPEN_CUSTOMIZE: AudioManager.I.StopDialogue(false); // Reset state for the tutorial var anturaModelManager = FindObjectOfType <AnturaModelManager>(); if (anturaModelManager) { anturaModelManager.ClearLoadedRewardPacks(); } AppManager.I.Player.CurrentAnturaCustomizations.ClearEquippedProps(); DialogueThen( LocalizationDataId.AnturaSpace_Custom_1, () => { m_oCustomizationButton.gameObject.SetActive(true); m_oCustomizationButton.onClick.AddListener(StepTutorialCustomization); TutorialUI.ClickRepeat(m_oCustomizationButton.transform.position, float.MaxValue, 1); CurrentTutorialFocus = m_oCustomizationButton; Dialogue(LocalizationDataId.AnturaSpace_Custom_2); }); break; case CustomizationTutorialStep.SELECT_CATEGORY: m_oCustomizationButton.onClick.RemoveListener(StepTutorialCustomization); CurrentTutorialFocus = null; StartCoroutine(DelayedCallbackCO( () => { m_oCategoryButton = _mScene.UI.GetNewCategoryButton(); if (m_oCategoryButton == null) { m_oCategoryButton = _mScene.UI.GetFirstUnlockedCategoryButton(); } m_oCategoryButton.Bt.onClick.AddListener(StepTutorialCustomization); CurrentTutorialFocus = m_oCategoryButton; TutorialUI.ClickRepeat(m_oCategoryButton.transform.position, float.MaxValue, 1); })); break; case CustomizationTutorialStep.SELECT_ITEM: // Unregister from category button m_oCategoryButton.Bt.onClick.RemoveListener(StepTutorialCustomization); CurrentTutorialFocus = null; StartCoroutine(DelayedCallbackCO( () => { // Register on item button m_oItemButton = _mScene.UI.GetNewItemButton(); if (m_oItemButton == null) { m_oItemButton = _mScene.UI.GetFirstUnlockedItemButton(); } m_oItemButton.Bt.onClick.AddListener(StepTutorialCustomization); CurrentTutorialFocus = m_oItemButton; TutorialUI.ClickRepeat(m_oItemButton.transform.position, float.MaxValue, 1); })); break; case CustomizationTutorialStep.SELECT_COLOR: Dialogue(LocalizationDataId.AnturaSpace_Custom_3); CurrentTutorialFocus = null; // Cleanup last step m_oItemButton.Bt.onClick.RemoveListener(StepTutorialCustomization); CurrentTutorialFocus = null; StartCoroutine(DelayedCallbackCO( () => { // Register on item button m_oSwatchButton = _mScene.UI.GetRandomUnselectedSwatch(); m_oSwatchButton.Bt.onClick.AddListener(StepTutorialCustomization); TutorialUI.ClickRepeat(m_oSwatchButton.transform.position, float.MaxValue, 1); })); break; case CustomizationTutorialStep.CLOSE_CUSTOMIZE: Dialogue(LocalizationDataId.AnturaSpace_Custom_4); // Cleanup last step m_oSwatchButton.Bt.onClick.RemoveListener(StepTutorialCustomization); // New step m_oAnturaBehaviour.onTouched += StepTutorialCustomization; m_oCustomizationButton.onClick.AddListener(StepTutorialCustomization); CurrentTutorialFocus = m_oCustomizationButton; StartCoroutine(DelayedCallbackCO( () => { TutorialUI.ClickRepeat(m_oCustomizationButton.transform.position, float.MaxValue, 1); })); /* * // New step * StartCoroutine(WaitAnturaInCenterCO( * () => { * Vector3 clickOffset = m_oAnturaBehaviour.IsSleeping ? Vector3.down * 2 : Vector3.down * 1.5f; * TutorialUI.ClickRepeat( * m_oAnturaBehaviour.gameObject.transform.position + clickOffset + Vector3.forward * -2 + Vector3.up, * float.MaxValue, 1); * })); */ break; case CustomizationTutorialStep.FINISH: // Cleanup last step m_oCustomizationButton.onClick.RemoveListener(StepTutorialCustomization); m_oAnturaBehaviour.onTouched -= StepTutorialCustomization; CurrentTutorialFocus = null; CompleteTutorialPhase(); break; } }
public void OnEggButtonPressed(ILivingLetterData letterData) { if (isSequence && game.eggButtonBox.GetEggButton(letterData).IsPressed()) { return; } if (!enteredRepeatMode) { game.Context.GetAudioManager().PlayVocabularyData(letterData, false); } else { game.Context.GetAudioManager().PlaySound(Sfx.UIButtonClick); } if (showTutorial) { if (!enteredRepeatMode) { TutorialUI.Clear(false); } tutorialDelayTimer = tutorialDelayTime; tutorialCorrectActive = false; } if (DataMatchingHelper.IsDataMatching(letterData, game.CurrentQuestion.Answers[letterOnSequence], LetterEqualityStrictness.Letter)) { if (isSequence) { game.eggButtonBox.GetEggButton(letterData).SetPressed(); PositiveFeedback(); game.Context.GetLogManager().OnAnswered(letterData, true); } else { repeatInputHasProgressed = true; if (!enteredRepeatMode) { EggConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.OK); enteredRepeatMode = true; game.HintButton.gameObject.SetActive(false); Vector3 clickPosition = game.eggButtonBox.GetButtons(false)[0].transform.position; TutorialUI.ClickRepeat(clickPosition, 4); game.eggButtonBox.RemoveButtons((a) => { return(a != letterData); }); if (!showTutorial) { game.Context.GetLogManager().OnAnswered(letterData, true); } } } } else { game.eggButtonBox.SetButtonsOnStandardColor(game.eggButtonBox.GetEggButton(letterData)); if (showTutorial) { ShowTutorialPressedWrong(letterData); } else { NegativeFeedback(); game.Context.GetLogManager().OnAnswered(letterData, false); } } }