示例#1
0
 IEnumerator co_Lost()
 {
     if (status == LLStatus.StandingOnBelt)
     {
         status = LLStatus.Sad;
         LLController.DoAngry();
         yield return(new WaitForSeconds(1.5f));
     }
     Debug.Log(status);
     if (status != LLStatus.Flying || status != LLStatus.Falling || status != LLStatus.None)
     {
         LLController.Poof();
         yield return(new WaitForSeconds(0.2f));
     }
     else
     {
         yield return(new WaitForSeconds(2f));
     }
     transform.position = new Vector3(-100, -100, -100); // Move offscreen
 }
示例#2
0
        public void ShowLose(ILivingLetterData livingLetterData)
        {
            this.transform.position = offscreenPosition;
            LLPrefab.gameObject.SetActive(true);
            vfx.gameObject.SetActive(false);
            if (livingLetterData != null)
            {
                LLPrefab.Init(livingLetterData);
            }
            LLPrefab.DoAngry();
            TutorialUI.MarkNo(Random.value <= 0.5f ? wrongMarkPosition1 : wrongMarkPosition2, TutorialUI.MarkSize.Huge);
            BalloonsConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.KO);

            StartCoroutine(Move_Coroutine(offscreenPosition, onscreenPosition, moveDuration));
        }
示例#3
0
        public void Update(float delta)
        {
            tryAnturaTimer -= delta;

            if (m_Rounds <= 0 || game.starsAwarded >= 3)
            {
                game.SetCurrentState(game.ResultState);
            }
            else
            {
                bool stillWaitForInput = !(m_HitStateLLController != null && m_HitStateLLController.hitState == eHitState.HIT_LETTEROUTSIDE) && (m_TMPTextColoringLetter != null && m_TMPTextColoringLetter.IsTouching);

                CalcPercentageLetterColored();

                if (m_bLLVanishing) //if the LL is about to vanish
                {
                    m_fDisappearTimeProgress += Time.deltaTime;

                    //if(m_LetterObjectView.GetState()!=LLAnimationStates.LL_dancing)//when the dance is finished ---> DoDancingWin/Lose do not exit from this state
                    if (m_fDisappearTimeProgress >= m_fTimeToDisappear) //after the given time is reached
                    {
                        m_LetterObjectView.Poof();                      //LL vanishes
                        game.Context.GetAudioManager().PlaySound(Sfx.Poof);

                        //stop win particle
                        foreach (var particles in game.winParticle.GetComponentsInChildren <ParticleSystem>(true))
                        {
                            particles.Stop();
                        }
                        game.winParticle.SetActive(false);

                        m_bLLVanishing           = false;
                        m_fDisappearTimeProgress = 0;

                        //just for possible reusing of the LL renable components
                        EnableLetterComponents();

                        m_CurrentLetter.SetActive(false);
                        var controller = m_CurrentLetter.GetComponent <HitStateLLController>();
                        if (controller != null)
                        {
                            controller.OnTouchedOutside -= OnTickled;
                            controller.OnTouchedShape   -= TryEnableAntura;
                        }

                        --m_Rounds;
                        if (m_Rounds > 0) //activate next LL
                        {
                            ResetState();
                            m_ColorsUIManager.ChangeButtonsColor();
                            tickled         = false;
                            m_CurrentLetter = game.myLetters[m_Rounds - 1];
                            m_CurrentLetter.gameObject.SetActive(true);
                            // Initialize the next letter
                            InitLetter();
                        }
                    }
                }
                else if ((m_PercentageLetterColored >= 100 && !stillWaitForInput) || m_Lives <= 0) //else check for letter completed
                {
                    game.anturaController.ForceAnturaToGoBack();                                   //we completed the letter, antura turn back
                    m_bLLVanishing = true;                                                         //LL is about to disappear

                    //disable color components to avoid input in this phase (or ignore input using touch manager?)
                    DisableLetterComponents();

                    ColorTickleConfiguration.Instance.Context.GetAudioManager().PlayVocabularyData(
                        m_LetterObjectView.Data,
                        soundType: ColorTickleConfiguration.Instance.GetVocabularySoundType()
                        );                           //play letter pronounce again

                    m_SurfaceColoringLetter.Reset(); //reset to clean surface of LL (maybe make a function to clean it rather than reinitialize it)

                    //LL does win or lose animation
                    if (m_PercentageLetterColored >= 100)
                    {
                        m_iRoundsSuccessfull += 1;
                        game.CurrentScore     = m_iRoundsSuccessfull;

                        m_LetterObjectView.DoHorray();
                        ColorTickleConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.Win);

                        game.Context.GetLogManager().OnAnswered(m_LetterObjectView.Data, true);

                        //play win particle
                        game.winParticle.SetActive(true);
                        foreach (var particles in game.winParticle.GetComponentsInChildren <ParticleSystem>(true))
                        {
                            particles.Play();
                        }
                    }
                    else if (m_Lives <= 0)
                    {
                        /*m_LetterObjectView.DoDancingLose(); //this just set trigger for lose on dancing animation
                         * m_LetterObjectView.SetState(LLAnimationStates.LL_dancing);*/
                        m_LetterObjectView.DoAngry();
                        game.Context.GetLogManager().OnAnswered(m_LetterObjectView.Data, false);
                        game.Context.GetAudioManager().PlaySound(Sfx.LetterAngry);
                        game.Context.GetAudioManager().PlaySound(Sfx.Lose);
                    }
                }
                else if (tickled)
                {
                    tickled = false;
                    if (m_CurrentLetter != null)
                    {
                        m_CurrentLetter.GetComponent <HitStateLLController>().TicklesLetter();
                    }
                    LoseLife();
                }
            }
        }
示例#4
0
 public void LookAngry()
 {
     LLPrefab.DoAngry();
 }
        void Update()
        {
            letter.HasFear = fear;
            letter.SetWalkingSpeed(walkSpeed);
            letter.SetDancingSpeed(danceSpeed);

            if (doTransition)
            {
                doTransition = false;
                letter.SetState(targetState);
            }

            if (doHooray)
            {
                doHooray = false;
                letter.DoHorray();
            }


            if (doAngry)
            {
                doAngry = false;
                letter.DoAngry();
            }


            if (doHighFive)
            {
                doHighFive = false;
                letter.DoHighFive();
            }


            if (onJumpStart)
            {
                onJumpStart = false;
                letter.OnJumpStart();
            }


            if (onJumpMiddle)
            {
                onJumpMiddle = false;
                letter.OnJumpMaximumHeightReached();
            }



            if (onJumpEnd)
            {
                onJumpEnd = false;
                letter.OnJumpEnded();
            }

            if (doSmallJump)
            {
                doSmallJump = false;
                letter.DoSmallJump();
            }

            if (doDanceWin)
            {
                doDanceWin = false;
                letter.DoDancingWin();
            }

            if (doDanceLose)
            {
                doDanceLose = false;
                letter.DoDancingLose();
            }

            if (doTwirl)
            {
                doTwirl = false;
                letter.DoTwirl(() => { Debug.Log("BACK!"); });
            }

            if (doToggleDance)
            {
                doToggleDance = false;
                letter.ToggleDance();
            }
        }