Exemplo n.º 1
0
    private void OpenTutorialUIs(TutorialData[] tutorials, bool displayUpgrades)
    {
        // Local function returns the functor that opens the correct tutorial
        // this prevents capturing local variables
        UnityAction OpenTutorial(TutorialUI tutorial, TutorialData data)
        {
            return(() => tutorial.Open(data, displayUpgrades));
        }

        // The current and previous UI
        TutorialUI current  = TutorialUI.InstantiateFromResources(rootPanel.transform);
        TutorialUI previous = current;

        // Open the current UI
        current.Open(tutorials[0], displayUpgrades);

        // Run a loop through all tutorials after the first one
        for (int i = 1; i < tutorials.Length; i++)
        {
            // Create the ui, starting off disabled
            current = TutorialUI.InstantiateFromResources(rootPanel.transform);
            current.RootRect.gameObject.SetActive(false);

            // When the previous ui is closed, then open the next one
            previous.OnTutorialClosed.AddListener(OpenTutorial(current, tutorials[i]));

            // Update previous to current before moving on
            previous = current;
        }

        // When the last tutorial is closed then finish the tutorial
        current.OnTutorialClosed.AddListener(Finish);
    }
Exemplo n.º 2
0
        void Start()
        {
            StartCoroutine(coDoTutorial());

            //warm up
            TutorialUI.DrawLine(-100 * Vector3.up, -100 * Vector3.up, TutorialUI.DrawLineMode.Arrow);
        }
Exemplo n.º 3
0
        private IEnumerator ShowTutorialUI_Coroutine()
        {
            while (MakeFriendsGame.Instance.SpokenWords < 2)
            {
                yield return(null);
            }

            yield return(new WaitForSeconds(0.5f));

            livingLetter1.LLPrefab.LabelRender.SetFlashingText(livingLetter1.wordData.Data, commonLetters[0] as LL_LetterData, false);
            livingLetter2.LLPrefab.LabelRender.SetFlashingText(livingLetter2.wordData.Data, commonLetters[0] as LL_LetterData, false);

            while (isTutorialRound)
            {
                for (int i = 0; i < letterPicker.CorrectLetterChoices.Count; i++)
                {
                    var choice = letterPicker.CorrectLetterChoices[i];

                    if (choice.isCorrectChoice && !choice.IsDisabled && !letterPicker.IsBlocked)
                    {
                        var from = choice.transform.position;
                        var to   = dropZone.transform.position;
                        TutorialUI.SetCamera(uiCamera);
                        TutorialUI.DrawLine(from, to, TutorialUI.DrawLineMode.Finger, false, false);
                    }
                }
                yield return(new WaitForSeconds(2f));
            }
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 7
0
        IEnumerator CorrectMove(bool roundWon)
        {
            //AudioManager.I.PlayDialog("comment_welldone");
            DancingDotsConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.OK);
            TutorialUI.MarkYes(dancingDotsLL.transform.position + Vector3.up * 19 - Vector3.forward * 4, TutorialUI.MarkSize.Big);
            AudioManager.I.PlayDialogue("Keeper_Good_" + UnityEngine.Random.Range(1, 13));
            dancingDotsLL.ShowRainbow();
            dancingDotsLL.letterObjectView.SetDancingSpeed(1f);


            if (roundWon)
            {
                StartCoroutine(RoundWon());
            }
            else
            {
                dancingDotsLL.letterObjectView.DoHorray(); // ("Jump");
                yield return(new WaitForSeconds(1f));

                dancingDotsLL.HideRainbow();
                dancingDotsLL.letterObjectView.ToggleDance();
                //                yield return new WaitForSeconds(1f);
                tutorial.doTutorial();
                //startUI();
            }
        }
Exemplo n.º 8
0
        void DrawTutorial()
        {
            if (game.QuestionManager.crowd.GetLetter(game.QuestionManager.dropContainer.GetActiveData()) == null)
            {
                return;
            }

            StrollingLivingLetter tutorialLetter = game.QuestionManager.crowd.GetLetter(game.QuestionManager.dropContainer.GetActiveData());

            Vector3 startLine = tutorialLetter.gameObject.GetComponent <LetterObjectView>().contentTransform.position;
            Vector3 endLine   = game.QuestionManager.dropContainer.transform.position;

            List <StrollingLivingLetter> nearLetters = new List <StrollingLivingLetter>();

            game.QuestionManager.crowd.GetNearLetters(nearLetters, startLine, 10f);

            for (int i = 0; i < nearLetters.Count; i++)
            {
                if (nearLetters[i] != tutorialLetter)
                {
                    nearLetters[i].Scare(startLine, 3f);
                }
            }

            tutorialLetter.Tutorial();

            TutorialUI.DrawLine(startLine, endLine, TutorialUI.DrawLineMode.Finger);
        }
    protected IEnumerator LoadTutorialUI(string resourceName)
    {
        GameObject go = AssetDataMng.Instance().LoadObject(resourceName, null, true) as GameObject;

        yield return(null);

        GameObject ui = UnityEngine.Object.Instantiate <GameObject>(go);

        yield return(null);

        ui.transform.parent        = Singleton <GUIMain> .Instance.transform;
        ui.transform.localScale    = Vector3.one;
        ui.transform.localPosition = new Vector3(0f, 0f, -2000f);
        ui.transform.localRotation = Quaternion.identity;
        this.tutorialUI            = ui.GetComponent <TutorialUI>();
        go = null;
        Resources.UnloadUnusedAssets();
        List <Coroutine> routine = new List <Coroutine>();

        routine.Add(AppCoroutine.Start(this.tutorialUI.LoadMessageWindow(), false));
        routine.Add(AppCoroutine.Start(this.tutorialUI.LoadImageWindow(), false));
        routine.Add(AppCoroutine.Start(this.tutorialUI.LoadThumbnail(), false));
        for (int i = 0; i < routine.Count; i++)
        {
            yield return(routine[i]);
        }
        yield break;
    }
Exemplo n.º 10
0
        public void WrongMove(GameObject GO, ScannerLivingLetter livingLetter)
        {
            numberOfFailedMoves++;
            TutorialUI.MarkNo(GO.transform.position + Vector3.up * 2 + Vector3.right * 1.5f, TutorialUI.MarkSize.Normal);
            AudioManager.I.PlaySound(Sfx.KO);
            KeeperManager.I.PlayDialogue("Keeper_Bad_" + UnityEngine.Random.Range(1, 6));
            game.LogAnswer(livingLetter.LLController.Data, false);
            game.CreatePoof(GO.transform.position, 2f, true);
            game.Context.GetOverlayWidget().SetLives(game.allowedFailedMoves - numberOfFailedMoves);

            if (game.tut.isTutRound)
            {
                GO.GetComponent <ScannerSuitcase>().Reset();
                return;
            }

            GO.SetActive(false);

            if (numberOfFailedMoves >= game.allowedFailedMoves ||
                ScannerConfiguration.Instance.Variation == ScannerVariation.MultipleWords)
            {
                game.StopAllCoroutines();

                game.StartCoroutine(RoundLost());
            }
        }
Exemplo n.º 11
0
 public TutorialCommandSkip(ScriptEngine scriptEngine, TutorialUI tutorialUI, TutorialControlToGame controlToGame) : base(scriptEngine, tutorialUI, controlToGame)
 {
     this.SuspendCommand();
     this.actionList.Add(ScriptEngine.Status.WAIT_WINDOW, new Action(this.SkipOpenWindow));
     this.actionList.Add(ScriptEngine.Status.WAIT_WINDOW_DELETE, new Action(this.SkipCloseWindow));
     this.actionList.Add(ScriptEngine.Status.WAIT_MESSAGE_DISPLAY, new Action(this.SkipDisplayMessage));
     this.actionList.Add(ScriptEngine.Status.WAIT_CHARA, new Action(this.SkipDisplayChara));
     this.actionList.Add(ScriptEngine.Status.SET_CHARA_POS, new Action(base.SetCharaPosition));
     this.actionList.Add(ScriptEngine.Status.SET_CHARA_FACE, new Action(this.SkipChangeCharaFace));
     this.actionList.Add(ScriptEngine.Status.WAIT_CHARA_DELETE, new Action(this.SkipInvisibleChara));
     this.actionList.Add(ScriptEngine.Status.SET_MASK_CONTROL, new Action(this.SkipMaskTween));
     this.actionList.Add(ScriptEngine.Status.WAIT_FADE, new Action(this.SkipFadeTween));
     this.actionList.Add(ScriptEngine.Status.WAIT_SAVE, new Action(this.SkipTutorialStateSave));
     this.actionList.Add(ScriptEngine.Status.WAIT_SHAKE, new Action(this.SkipShakeScreen));
     this.actionList.Add(ScriptEngine.Status.WAIT_SHAKE_STOP, new Action(this.SkipShakeScreenStop));
     this.actionList.Add(ScriptEngine.Status.WAIT_UI_POP, new Action(this.SkipUIPop));
     this.actionList.Add(ScriptEngine.Status.WAIT_FARM_TARGET, new Action(this.SkipFarmTarget));
     this.actionList.Add(ScriptEngine.Status.WAIT_QUEST_SET, new Action(this.SkipQuestSet));
     this.actionList.Add(ScriptEngine.Status.SET_BATTLE_PAUSE, new Action(this.SetBattlePause));
     this.actionList.Add(ScriptEngine.Status.SET_BATTLE_MANUAL, new Action(this.SetBattleManual));
     this.actionList.Add(ScriptEngine.Status.SET_SOUND_VOLUME, new Action(this.SetSoundVolume));
     this.actionList.Add(ScriptEngine.Status.SET_BGM, new Action(this.SetBgm));
     this.actionList.Add(ScriptEngine.Status.SET_SE, new Action(this.SetSe));
     this.actionList.Add(ScriptEngine.Status.WAIT_SCREEN_EFFECT, new Action(this.SkipScreenEffect));
     this.actionList.Add(ScriptEngine.Status.SET_BATTLE_AUTO_ON, new Action(this.SetBattleAutoOn));
     this.actionList.Add(ScriptEngine.Status.SET_MEAT_NUM, new Action(base.SetMeatNum));
     this.actionList.Add(ScriptEngine.Status.SET_DIGI_STONE_NUM, new Action(base.SetDigiStoneNum));
     this.actionList.Add(ScriptEngine.Status.SET_DIGIMON_EXP, new Action(this.SetDigimonExp));
     this.actionList.Add(ScriptEngine.Status.SKIP_END, new Action(this.SkipEnd));
     this.actionList.Add(ScriptEngine.Status.SET_NON_FRAME_TEXT, new Action(this.SetNonFrameText));
     this.actionList.Add(ScriptEngine.Status.SET_NON_FRAME_TEXT_END, new Action(this.SetNonFrameTextEnd));
     this.actionList.Add(ScriptEngine.Status.BATTLE_SKIP_END, new Action(this.BattleSkipEnd));
 }
Exemplo n.º 12
0
        public void onCorrectMove(SickLettersDraggableDD dd)
        {
            if (goodCommentCounter == 3 || !lastMoveIsCorrect)
            {
                KeeperManager.I.PlayDialogue("Keeper_Good_" + UnityEngine.Random.Range(1, 13));
                goodCommentCounter = 0;
            }

            scale.counter++;
            goodCommentCounter++;
            lastMoveIsCorrect = true;
            dd.deattached     = true;


            if (!dd.touchedVase)
            {
                dd.boxCollider.isTrigger = false;
            }

            TutorialUI.MarkYes(scale.transform.position - Vector3.forward * 2 + Vector3.up, TutorialUI.MarkSize.Big);
            Context.GetAudioManager().PlaySound(Sfx.OK);
            Context.GetLogManager().OnAnswered(LLPrefab.letterView.Data, true);

            if (scale.counter > maxReachedCounter)
            {
                Context.GetOverlayWidget().SetStarsThresholds(STARS_1_THRESHOLD, STARS_2_THRESHOLD, STARS_3_THRESHOLD);
                CurrentScore = scale.counter;
            }

            dd.isInVase       = true;
            dd.gameObject.tag = "Finish";

            checkForNextRound();
        }
Exemplo n.º 13
0
        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;
            }
        }
        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 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;
            }
        }
Exemplo n.º 16
0
        public override bool RunScriptCommand()
        {
            UnityEngine.Object original   = Resources.Load("UIBackground/Background6");
            GameObject         gameObject = UnityEngine.Object.Instantiate(original) as GameObject;

            if (ClassSingleton <AdventureSceneData> .Instance.commonBackground == null)
            {
                UIRoot     uiroot = UnityEngine.Object.FindObjectOfType <UIRoot>();
                TutorialUI componentInChildren = uiroot.GetComponentInChildren <TutorialUI>();
                componentInChildren.CommonBackground = gameObject;
                gameObject.transform.SetParent(componentInChildren.transform);
                gameObject.transform.localScale = Vector3.one;
            }
            ClassSingleton <AdventureSceneData> .Instance.commonBackground = gameObject;
            gameObject.name = "ShowBackgroundCommandObj";
            UITexture componentInChildren2 = gameObject.GetComponentInChildren <UITexture>();

            componentInChildren2.depth = this.depth;
            Texture2D mainTexture;

            if (this.switchKey == "res")
            {
                mainTexture = (Resources.Load(this.path) as Texture2D);
            }
            else
            {
                mainTexture = (MonsterIconCacheBuffer.Instance().LoadAndCacheObj(this.path, null) as Texture2D);
            }
            componentInChildren2.mainTexture = mainTexture;
            base.ResumeScriptEngine();
            return(true);
        }
        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;
        }
Exemplo n.º 18
0
        void Update()
        {
            if (StartTutorial)
            {
                m_Delay += Time.deltaTime;
                if (m_Delay >= m_MaxDelay)
                {
                    m_Delay = 0;

                    toggleLine = !toggleLine;

                    Vector3[] path = null;
                    if (toggleLine)
                    {
                        path = new Vector3[m_Finger1Positions.Length];
                        for (int i = 0; i < m_Finger1Positions.Length; i++)
                        {
                            path[i] = m_Finger1Positions[i].position;
                        }
                    }
                    else
                    {
                        path = new Vector3[m_Finger2Positions.Length];
                        for (int i = 0; i < m_Finger2Positions.Length; i++)
                        {
                            path[i] = m_Finger2Positions[i].position;
                        }
                    }
                    TutorialUI.DrawLine(path, TutorialUI.DrawLineMode.Finger);
                }
            }
        }
Exemplo n.º 19
0
        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();
            }
        }
Exemplo n.º 20
0
        void TutorialDrawLine()
        {
            Vector3 lineFrom = game.questionsManager.GetQuestionLivingLetter().letter.contentTransform.position;
            Vector3 lineTo   = game.pipesAnswerController.GetCorrectPipeAnswer().tutorialPoint.position;

            TutorialUI.DrawLine(lineFrom, lineTo, TutorialUI.DrawLineMode.FingerAndArrow);
        }
Exemplo n.º 21
0
        public void WrongMove(Vector3 pos)
        {
            //DancingDotsConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.KO);

            //DancingDotsConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.StampOK);
            TutorialUI.MarkNo(dancingDotsLL.transform.position + Vector3.up * 19 - Vector3.forward * 4, TutorialUI.MarkSize.Big);

            AudioManager.I.PlayDialogue("Keeper_Bad_" + UnityEngine.Random.Range(1, 6));
            numberOfFailedMoves++;
            dancingDotsLL.letterObjectView.SetDancingSpeed(1f - numberOfFailedMoves * 0.25f);
            GameObject splat = (GameObject)Instantiate(splatPrefab);

            splat.transform.parent        = splatParent;
            splat.transform.localScale    = new Vector3(1f, 1f, 1f);
            splat.transform.localRotation = Quaternion.Euler(0f, 0f, 0f);
            splat.transform.position      = pos;
            splat.transform.localPosition = new Vector3(splat.transform.localPosition.x, splat.transform.localPosition.y, 0f);

            splats.Add(splat.GetComponent <DancingDotsSplat>());

            if (numberOfFailedMoves >= allowedFailedMoves)
            {
                StartCoroutine(RoundLost());
            }
        }
Exemplo n.º 22
0
 public override void Inject(GameplayManager gameplayManager)
 {
     stateMachine = gameplayManager.fsm;
     input        = gameplayManager.input;
     ui           = gameplayManager.tutorialUI;
     textSpeed    = gameplayManager.tutorialTextAppearSpeed;
 }
        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;
            }
        }
        public void EnterState()
        {
            if (game.currentLetter.collidedTubes.Count == 0)
            {
                win = false;
                game.currentLetter.respawn = true;
                return;
            }

            int tubeIndex = int.Parse(game.currentLetter.collidedTubes[game.currentLetter.collidedTubes.Count - 1].name.Substring(5));

            UnityEngine.Vector3 markPosition = game.currentLetter.collidedTubes[game.currentLetter.collidedTubes.Count - 1].cubeInfo.transform.position + new UnityEngine.Vector3(0, 0, -3);
            win = false;
            if (tubeIndex == game.currentTube)
            {
                TakeMeHomeConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.Win);
                //AudioManager.I.PlaySfx (Sfx.Win);
                win = true;
                game.IncrementScore();
                TutorialUI.MarkYes(markPosition, TutorialUI.MarkSize.Big);
            }
            else
            {
                TakeMeHomeConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.Lose);
                TutorialUI.MarkNo(markPosition, TutorialUI.MarkSize.Big);
            }

            game.currentLetter.followTube(win);
        }
Exemplo n.º 25
0
        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);
        }
Exemplo n.º 26
0
        private void HideTutorialUI()
        {
            StopCoroutine("ShowTutorialUI_Coroutine");
            TutorialUI.Clear(false);

            livingLetter1.LLPrefab.LabelRender.StopFlashing();
            livingLetter2.LLPrefab.LabelRender.StopFlashing();
        }
Exemplo n.º 27
0
        void ShowTutorialPressedWrong(ILivingLetterData letterData)
        {
            letterOnSequence = 0;
            questionProgress = 0;

            Vector3 markPosition = game.eggButtonBox.GetEggButton(letterData).transform.position;

            TutorialUI.MarkNo(markPosition, TutorialUI.MarkSize.Normal);
        }
Exemplo n.º 28
0
        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>();
            });
        }
Exemplo n.º 29
0
 public void onWrongMove()
 {
     Debug.Log("XXXXX " + Time.deltaTime);
     lastMoveIsCorrect  = false;
     goodCommentCounter = correctMoveSequence = 0;
     AudioManager.I.PlayDialog("Keeper_Bad_" + UnityEngine.Random.Range(1, 6));
     TutorialUI.MarkNo(scale.transform.position - Vector3.forward * 2 + Vector3.up, TutorialUI.MarkSize.Big);
     Context.GetAudioManager().PlaySound(Sfx.Lose);
 }
 private void Awake()
 {
     _ui = FindObjectOfType <TutorialUI>();
     if (_ui == null)
     {
         Debug.LogWarning("No Tutorial UI found in Scene");
     }
     _elements = new List <GameObject>();
 }
Exemplo n.º 31
0
    void Start()
    {
        if (instance == null)
            instance = this;

        tutorialPanelImage = transform.GetChild(0).GetComponent<Image>();
        playerNutrientText = transform.GetChild(1).GetComponent<Text>();
        playerNodeTapText = transform.GetChild(2).GetComponent<Text>();
        playerNodeHoldText = transform.GetChild(3).GetComponent<Text>();
        playerNodeCommandText = transform.GetChild(4).GetComponent<Text>();
        squadCaptainSpawnText = transform.GetChild(5).GetComponent<Text>();
        enemyMainProductionText = transform.GetChild(6).GetComponent<Text>();
        enemyMainDefendText = transform.GetChild(7).GetComponent<Text>();
        enemyMainCautiousAttackText = transform.GetChild(8).GetComponent<Text>();
        enemyMainAggressiveAttackText = transform.GetChild(9).GetComponent<Text>();
        enemyMainLandmineText = transform.GetChild(10).GetComponent<Text>();
        endingText = transform.GetChild(11).GetComponent<Text>();
    }