예제 #1
0
        void BuildEmptyStateStructure()
        {
            m_questionManager.SetSelectedQuizType(QuestionManager.QuizTypes.Jigsaw);
            string[] allQuizNames = m_questionManager.AllQuizNamesInCurrentMode();
            m_playerProgress = new SingleQuizState[allQuizNames.Length];
            for (int i = 0; i < allQuizNames.Length; i++)
            {
                m_questionManager.SetQuiz(allQuizNames[i]);
                int questionCount = m_questionManager.GetNumberOfQuestions();

                m_playerProgress[i]             = new SingleQuizState();
                m_playerProgress[i].m_questions = new int[questionCount];
            }
        }
        IEnumerator ZoomSequence()
        {
            float fadeInTime  = 0.2f;
            float pauseTime   = 1.0f;
            float fadeOutTime = 0.35f;

            messageText.text = "streak x" + _streakCount;

            //yield return new WaitForSeconds(0.9f);

            int secondaryMessageNum = 0;

            if (_streakCount == _questionManager.GetNumberOfQuestions())
            {
                secondaryMessageNum = 3;
                if (_audioManager)
                {
                    _audioManager.PlayAudioClip("streakPerfectRun");
                }
            }
            else if (_streakCount >= 6)
            {
                secondaryMessageNum = 2;
                if (_audioManager)
                {
                    _audioManager.PlayAudioClip("streakAmazing");
                }
            }
            else if (_streakCount >= 4)
            {
                secondaryMessageNum = 1;
                if (_audioManager)
                {
                    _audioManager.PlayAudioClip("streakExcellent");
                }
            }
            else
            {
                if (_audioManager)
                {
                    _audioManager.PlayAudioClip("streakNormal");
                }
            }



            EnableSpecificSecondaryMessage(secondaryMessageNum);

            foreach (Visibility vis in visibilityComponents)
            {
                vis.Hide();
                vis.FadeIn(0.25f);
            }
            secondaryMessages[secondaryMessageNum].SendMessage("Hide");
            secondaryMessages[secondaryMessageNum].SendMessage("FadeIn", 0.25f);
            Visibility parentVis = secondaryMessages[secondaryMessageNum].transform.parent.gameObject.GetComponent <Visibility>();

            parentVis.SetInitialAlpha(100f / 255);
            parentVis.Hide();
            parentVis.FadeIn(0.25f);

//			float aspectRatio = (float)texture.width / texture.height;
//			pictureAspectRatioFitterUI.aspectRatio = aspectRatio;

            Scaler scaler = gameObject.GetComponent <Scaler>();

            scaler.ScaleBackFrom(0.8f, fadeInTime);

            yield return(new WaitForSeconds(fadeInTime));

            yield return(new WaitForSeconds(pauseTime));

            scaler.ScaleTo(2.0f, fadeOutTime);

            foreach (Visibility vis in visibilityComponents)
            {
                vis.FadeOut(fadeOutTime / 2);
            }
            secondaryMessages[secondaryMessageNum].SendMessage("FadeOut", fadeOutTime / 2);
            parentVis.FadeOut(fadeOutTime / 2);

            yield return(new WaitForSeconds(fadeOutTime));

            if (finishedCallback != null)
            {
                finishedCallback();
            }
            Destroy(gameObject, 0.0f);
        }