void PositiveFeedback() { if (isSequence) { letterOnSequence++; } questionProgress++; float crackingProgress = (float)questionProgress / (float)correctAnswers; game.eggController.Cracking(crackingProgress); game.eggController.ParticleCorrectEnabled(); if (crackingProgress == 1f) { game.HintButton.gameObject.SetActive(false); game.Context.GetAudioManager().PlaySound(Sfx.EggBreak); game.eggController.EmoticonHappy(); game.eggController.ParticleWinEnabled(); DisableAllGameplayInput(); tutorialStop = true; TutorialUI.Clear(false); game.StartCoroutine(OnEggCrackComplete()); } else { PlayPositiveAudioFeedback(); game.eggController.EmoticonPositive(); } }
void OnMouseUp() { if (ScannerGame.disableInput || !isReady) { return; } if (overPlayermarker) { ScannerLivingLetter LL = player.transform.parent.GetComponent <ScannerLivingLetter>(); if (isCorrectAnswer && LL.letterObjectView.Data.Id == wordId) { LL.gotSuitcase = true; transform.parent = player.transform; transform.localPosition = new Vector3(5.5f, 1, -2); onCorrectDrop(gameObject, LL); transform.localScale = new Vector3(scale, scale, scale); TutorialUI.Clear(true); ScannerTutorial.TUT_STEP = 1; } else { onWrongDrop(gameObject); } } else { Reset(); } isDragging = false; overPlayermarker = false; }
void CheckResult(int id) { letterInAnimation = GetIdFromPosition(id); HideAndSeekLetterController script = ArrayLetters[letterInAnimation].GetComponent <HideAndSeekLetterController>(); if (script.view.Data.Id == GetCorrectAnswer().Id) { script.resultAnimation(true); AudioManager.I.PlaySfx(Sfx.Win); game.Context.GetCheckmarkWidget().Show(true); StartCoroutine(GoToPlay()); phase = -1; buttonRepeater.SetActive(false); } else { script.resultAnimation(false); ArrayTrees[1].GetComponent <CapsuleCollider>().enabled = true; phase = 2; TutorialUI.Clear(false); AudioManager.I.PlaySfx(Sfx.Lose); game.Context.GetCheckmarkWidget().Show(false); timeFinger = Time.time + animDuration + timeToWait; } }
void CheckResult(int id) { letterInAnimation = GetIdFromPosition(id); HideAndSeekLetterController script = ArrayLetters[letterInAnimation].GetComponent <HideAndSeekLetterController>(); if (script.view.Data.Id == GetCorrectAnswer().Id) { script.PlayResultAnimation(true); AudioManager.I.PlaySound(Sfx.Win); AudioManager.I.PlaySound(Sfx.OK); script.GetComponent <EmoticonsAnimator>().DoCorrect(); StartCoroutine(GoToPlay()); phase = -1; buttonRepeater.SetActive(false); } else { script.PlayResultAnimation(false); ArrayTrees[1].GetComponent <SphereCollider>().enabled = true; phase = 2; TutorialUI.Clear(false); AudioManager.I.PlaySound(Sfx.Lose); AudioManager.I.PlaySound(Sfx.KO); script.GetComponent <EmoticonsAnimator>().DoWrong(); timeFinger = Time.time + animDuration + timeToWait; } }
void MoveObject(int id) { HideAndSeekConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.BushRustlingOut); if (ArrayLetters.Length > 0) { script = ArrayLetters[GetIdFromPosition(id)].GetComponent <HideAndSeekLetterController>(); script.MoveTutorial(); } if (GetIdFromPosition(id) == 0) { ArrayTrees[0].GetComponent <SphereCollider>().enabled = false; ArrayTrees[1].GetComponent <SphereCollider>().enabled = true; // skip to phase 2 phase = 2; TutorialUI.Clear(false); timeFinger = Time.time + animDuration + timeToWait; } if (GetIdFromPosition(id) == 1) { ArrayTrees[1].GetComponent <SphereCollider>().enabled = false; phase = 3; TutorialUI.Clear(false); timeFinger = Time.time + animDuration + timeToWait; } }
void MoveObject(int id) { if (ArrayLetters.Length > 0) { script = ArrayLetters[GetIdFromPosition(id)].GetComponent <HideAndSeekLetterController>(); script.MoveTutorial(); } if (GetIdFromPosition(id) == 0) { ArrayTrees[0].GetComponent <CapsuleCollider>().enabled = false; phase = 1; TutorialUI.Clear(false); timeFinger = Time.time + animDuration + timeToWait; } if (GetIdFromPosition(id) == 1) { ArrayTrees[1].GetComponent <CapsuleCollider>().enabled = false; phase = 3; TutorialUI.Clear(false); timeFinger = Time.time + animDuration + timeToWait; } }
private void Update() { if (_ui == null) { return; } for (var i = 0; i < lines.Count; i++) { var line = lines[i]; if (ConditionsAreMet(line.Conditions)) { if (line == _currentLine) { return; } _currentLine = line; _ui.SetLine(line); Clear(); line.Elements.ForEach(x => { var element = Instantiate(x.Element, transform); element.transform.localPosition = x.Position; _elements.Add(element); }); return; } } _ui.Clear(); Clear(); }
private void HideTutorialUI() { StopCoroutine("ShowTutorialUI_Coroutine"); TutorialUI.Clear(false); livingLetter1.LLPrefab.LabelRender.StopFlashing(); livingLetter2.LLPrefab.LabelRender.StopFlashing(); }
void onTutorialEnd() { TutorialUI.Clear(true); ScannerConfiguration.Instance.beltSpeed = originalLLOnBeltSpeed; game.Context.GetOverlayWidget().Initialize(true, false, false); game.Context.GetOverlayWidget().SetStarsThresholds(game.STARS_1_THRESHOLD, game.STARS_2_THRESHOLD, game.STARS_3_THRESHOLD); }
public void ExitState() { if (showTutorial) { TutorialUI.Clear(true); } game.eggButtonBox.SetOnPressedCallback(null); }
void initCurrentLetter() { if (gameEnded) { return; } currentCharacter = null; currentTutorial = null; TutorialUI.Clear(false); addLine(); //get a new letter: IQuestionPack newQuestionPack = MazeConfiguration.Instance.Questions.GetNextQuestion(); List <ILivingLetterData> ldList = (List <ILivingLetterData>)newQuestionPack.GetCorrectAnswers(); LL_LetterData ld = (LL_LetterData)ldList[0]; int index = -1; if (allLetters.ContainsKey(ld.Id)) { index = allLetters[ld.Id]; } if (index == -1) { Debug.Log("Letter got from Teacher is: " + ld.Id + " - does not match 11 models we have, we will play sound of the returned data"); index = Random.Range(0, prefabs.Count); } currentLL = ld; currentPrefab = Instantiate(prefabs[index]); currentPrefab.GetComponent <MazeLetterBuilder>().build(() => { if (!isTutorialMode) { MazeConfiguration.Instance.Context.GetAudioManager().PlayVocabularyData( ld, soundType: MazeConfiguration.Instance.GetVocabularySoundType() ); } foreach (Transform child in currentPrefab.transform) { if (child.name == "Mazecharacter") { currentCharacter = child.GetComponent <MazeCharacter>(); } else if (child.name == "HandTutorial") { currentTutorial = child.GetComponent <HandTutorial>(); } } currentCharacter.gameObject.SetActive(false); currentMazeLetter = currentPrefab.GetComponentInChildren <MazeLetter>(); }); }
private void HandleAnturaTouched() { m_oAnturaBehaviour.onTouched -= HandleAnturaTouched; DialogueThen(LocalizationDataId.AnturaSpace_Intro_Touch, () => { TutorialUI.Clear(false); CompleteTutorialPhase(); } ); }
public void ExitState() { game.questionsManager.onAnswered -= OnAnswered; game.questionsManager.playerInputPointerUp -= OnPointerUp; TutorialUI.Clear(true); game.questionsManager.SetEnteringAudio(true); game.pipesAnswerController.SetSignHidingProbability(2 * Mathf.Clamp01(ToboganGame.I.Difficulty - 0.5f)); }
public void ExitState() { game.circleBox.GetComponent <CircleButtonBox>().Clear(); game.radialWidget.inFront = false; if (TutorialMode) { TutorialUI.Clear(true); } }
public void ExitState() { game.questionsManager.onAnswered -= OnAnswered; game.questionsManager.playerInputPointerUp -= OnPointerUp; TutorialUI.Clear(true); game.questionsManager.SetEnteringAudio(true); game.pipesAnswerController.SetSignHidingProbability(ToboganConfiguration.Instance.Difficulty); }
public void stopCurrentTutorial() { TutorialUI.Clear(false); wayPoints.Clear(); gameObject.SetActive(false); //set tutorial done: //isMovingOnPath = false; isStopped = true; }
void OnPointerUp(bool pointerUp) { if (!pointerUp) { tutorialStarted = true; TutorialUI.Clear(false); } this.pointerUp = pointerUp; }
private void ShowTutorialUI() { TutorialUI.Clear(false); Vector3 worldToScreen = Camera.main.WorldToScreenPoint(new Vector3(0, 8, -20)); Vector3 fromPoint = Camera.main.ScreenToWorldPoint(new Vector3(worldToScreen.x, worldToScreen.y, 20f)); Vector3 toPoint = LetterSpawner.instance.BiLerpForTutorialUI(tutorialTarget.transform.position); TutorialUI.DrawLine(fromPoint, toPoint, TutorialUI.DrawLineMode.FingerAndArrow); timeLeftToShowTutorialUI = TUTORIAL_UI_PERIOD; }
private void ShowTutorialUI() { TutorialUI.Clear(false); Vector3 worldToScreen = Camera.main.WorldToScreenPoint(new Vector3(0, 8, -20)); Vector3 fromPoint = Camera.main.ScreenToWorldPoint(new Vector3(worldToScreen.x, worldToScreen.y, 20f)); worldToScreen = Camera.main.WorldToScreenPoint(new Vector3(-1.5f, 4.5f, -22)); Vector3 toPoint = Camera.main.ScreenToWorldPoint(new Vector3(worldToScreen.x, worldToScreen.y, 20f)); TutorialUI.DrawLine(fromPoint, toPoint, TutorialUI.DrawLineMode.FingerAndArrow); timeLeftToShowTutorialUI = TUTORIAL_UI_PERIOD; }
public void ExitState() { var inputManager = game.Context.GetInputManager(); game.circleBox.GetComponent <CircleButtonBox>().Clear(); game.radialWidget.inFront = false; if (TutorialMode) { TutorialUI.Clear(true); } }
private void StartDrawDragLineFromTo(Transform fromTr, Transform toTr, Vector3 offset) { TutorialUI.Clear(false); Vector3[] path = new Vector3[3]; path[0] = fromTr.position + offset; path[2] = toTr.position + offset; path[1] = (path[0] + path[2]) / 2f + Vector3.up * 4 + Vector3.left * 2; dragLineAnimation = TutorialUI.DrawLine(path, TutorialUI.DrawLineMode.Finger, false, true); dragLineAnimation.MainTween.timeScale = 0.8f; dragLineAnimation.OnComplete(delegate { StartDrawDragLineFromTo(fromTr, toTr, offset); }); }
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 ExitState() { game.HintButton.gameObject.SetActive(false); UnityEngine.UI.Button.ButtonClickedEvent clickEvent = game.HintButton.onClick; if (clickEvent != null) { clickEvent.RemoveListener(OnHintPressed); } if (showTutorial) { TutorialUI.Clear(true); } game.eggButtonBox.SetOnPressedCallback(null); }
void onTutorialEnd() { TutorialUI.Clear(true); game.beltSpeed = originalLLOnBeltSpeed; if (ScannerConfiguration.Instance.Variation == ScannerVariation.OneWord) { game.Context.GetOverlayWidget().Initialize(true, false, true); game.Context.GetOverlayWidget().SetMaxLives(game.allowedFailedMoves); } else { game.Context.GetOverlayWidget().Initialize(true, false, false); } game.Context.GetOverlayWidget().SetStarsThresholds(game.STARS_1_THRESHOLD, game.STARS_2_THRESHOLD, game.STARS_3_THRESHOLD); }
private void StartDrawDragLineFrom(Transform fromTr) { TutorialUI.Clear(false); Vector3[] path = new Vector3[3]; path[0] = fromTr.position; path[1] = path[0] + Vector3.up * 4 + Vector3.left * 2; path[2] = m_oCameraUI.ScreenToWorldPoint(new Vector3(Screen.width / 2, Screen.height / 2)); path[2].z = path[1].z; dragLineAnimation = TutorialUI.DrawLine(path, TutorialUI.DrawLineMode.Finger); dragLineAnimation.MainTween.timeScale = 0.8f; dragLineAnimation.OnComplete(delegate { StartDrawDragLineFrom(fromTr); }); }
private void endGame() { if (gameEnded) { return; } gameEnded = true; MinigamesUI.Timer.Pause(); TutorialUI.Clear(false); // Reset physics collisions: Physics.IgnoreLayerCollision(10, 12, false); EndGame(CurrentStars, CurrentScore); }
public void lostCurrentLetter() { if (!currentCharacter || currentCharacter.isAppearing || !currentCharacter.gameObject.activeSelf) { return; } if (isTutorialMode) { hideCracks(); //remove last line if (lines.Count > 0) { lines[lines.Count - 1].positionCount = 0; lines.RemoveAt(lines.Count - 1); } pointsList.RemoveRange(0, pointsList.Count); //removeLines(); TutorialUI.Clear(false); addLine(); currentCharacter.resetToCurrent(); showCurrentTutorial(); return; } wrongLetters++; roundNumber++; MazeConfiguration.Instance.Context.GetLogManager().OnAnswered(currentLL, false); if (roundNumber == MAX_NUM_ROUNDS || CurrentStars == 3) { endGame(); return; } else { roundNumberText.text = "#" + (roundNumber + 1); restartCurrentLetter(); } }
IEnumerator coDoTutorial() { yield return(new WaitForSeconds(startDelay)); resetTut(null, null); onTutorialStart(); while (isTutRound) { if (pauseTut()) { yield return(null); continue; } if (TUT_STEP == 1) { //Debug.Log(llCounter+"<<<"); target = getNewTarget(); if (target) { TutorialUI.DrawLine(source.position - Vector3.forward * 2, target.position + new Vector3(0, scannerDevice.position.y - target.position.y, -2), TutorialUI.DrawLineMode.FingerAndArrow); } else { TutorialUI.Clear(true); } } else { //Debug.Log(Time.deltaTime + " b"); TutorialUI.DrawLine(source.position - Vector3.forward * 2, target.transform.position + new Vector3(5f, 3, -2), TutorialUI.DrawLineMode.FingerAndArrow); } yield return(new WaitForSeconds(repeatDelay)); } onTutorialEnd(); }
public void lostCurrentLetter() { if (!currentCharacter || currentCharacter.isAppearing || !currentCharacter.gameObject.activeSelf) { return; } if (isTutorialMode) { hideCracks(); //remove last line if (lines.Count > 0) { lines[lines.Count - 1].SetVertexCount(0); lines.RemoveAt(lines.Count - 1); } pointsList.RemoveRange(0, pointsList.Count); //removeLines(); TutorialUI.Clear(false); addLine(); currentCharacter.resetToCurrent(); showCurrentTutorial(); return; } wrongLetters++; currentLetterIndex++; if (currentLetterIndex == 6) { endGame(); return; } else { roundNumber.text = "#" + (currentLetterIndex + 1); MazeConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.Lose); restartCurrentLetter(); } }
public void OnCorrectLetterHit(LetterController correctLetterCntrl) { if (ThrowBallsConfiguration.Instance.Variation == ThrowBallsVariation.lettersinword && --numLettersRemaining != 0) { UpdateLettersForLettersInWord(correctLetterCntrl); OnBallLost(); BallController.instance.Reset(); } else if (isRoundOngoing) { if (roundNumber > 0) { numRoundsWon++; if (numRoundsWon == 1) { MinigamesUI.Starbar.GotoStar(0); } else if (numRoundsWon == 3) { MinigamesUI.Starbar.GotoStar(1); } else if (numRoundsWon == 5) { MinigamesUI.Starbar.GotoStar(2); } } else { TutorialUI.Clear(true); } game.StartCoroutine(ShowWinSequence(correctLetterCntrl)); BallController.instance.Disable(); isRoundOngoing = false; } }