Ejemplo n.º 1
0
    private IEnumerator StartPhase()
    {
        // Wait for the intro UI to fade in.
        yield return(StartCoroutine(UIController.Instance.ShowIntroUI()));

        // Show the reticle (since there is now a selection slider) and hide the radial.
        m_Reticle.Show();
        m_SelectionRadial.Hide();

        // Wait for the selection slider to finish filling.
        yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

        // Wait for the intro UI to fade out.
        yield return(StartCoroutine(UIController.Instance.HideIntroUI()));
    }
Ejemplo n.º 2
0
        private IEnumerator Start()
        {
            m_Reticle.Show();

            m_Radial.Hide();

            // In order, fade in the UI on how to use sliders, wait for the slider to be filled then fade out the UI.
            yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeIn()));

            yield return(StartCoroutine(m_HowToUseSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeOut()));

            yield return(StartCoroutine(m_CameraMovement.GameStart())); //move camera to right position and start shooting the ball

            // In order, fade in the UI on confirming the use of sliders, wait for the slider to be filled, then fade out the UI.
            yield return(StartCoroutine(m_HowToUseConfirmFader.InteruptAndFadeIn()));

            while (true)
            {
                yield return(StartCoroutine(m_HowToUseConfirmSlider.WaitForBarToFill()));

                //yield return StartCoroutine(m_HowToUseConfirmFader.InteruptAndFadeOut());

                yield return(StartCoroutine(m_BallShooter.ShootBall()));
            }

            //// Fade in the final UI.
            //yield return StartCoroutine (m_ReturnFader.InteruptAndFadeIn ());
        }
        private IEnumerator ShowMenu(UIFader fader, SelectionSlider slider)
        {
            yield return(StartCoroutine(fader.InteruptAndFadeIn()));

            yield return(StartCoroutine(slider.WaitForBarToFill()));

            yield return(StartCoroutine(fader.InteruptAndFadeOut()));
        }
Ejemplo n.º 4
0
    private IEnumerator ShowIntro()
    {
        // Wait for the intro UI to fade in.
        yield return(StartCoroutine(UIController.Instance.ShowIntroUI()));

        // Show the reticle (since there is now a selection slider) and hide the radial.
        Phylum phylum = SpawnManager.Instance.phyla[0];             // Get the phylum

        AnimalInfo.LoadAnimalInfo(phylum, isStaticAnimals);         // Loads animal info for phylum
        m_Reticle.Show();
        m_SelectionRadial.Hide();

        // Wait for the selection slider to finish filling.
        yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

        // Wait for the intro UI to fade out.
        yield return(StartCoroutine(UIController.Instance.HideIntroUI()));
    }
Ejemplo n.º 5
0
    private IEnumerator StartPhase()
    {
        yield return(StartCoroutine(uiController.ShowIntroUI()));

        reticle.Show();
        selectionRadial.Hide();
        yield return(StartCoroutine(selectionSlider.WaitForBarToFill()));

        yield return(StartCoroutine(uiController.HideIntroUI()));
    }
    private IEnumerator WaitForBarToFill(SelectionSlider slider)
    {
        yield return(StartCoroutine(slider.WaitForBarToFill()));

        barFilled = true;
        //Check if ask for assignation
        if (slider.name == "TagAssignationSlider")
        {
            //We fade the assignation steps and remove the autoassignation button
            VRTracker.instance.autoAssignation     = false;
            VRTracker.instance.assignationComplete = false;
        }
    }
Ejemplo n.º 7
0
        private IEnumerator StartPhase()
        {
            // Make sure the Outro UI is not being shown and the intro UI is.
            StartCoroutine(m_UIController.ShowIntroUI());
            StartCoroutine(m_UIController.HideOutroUI());

            m_CameraContainer.transform.position = new Vector3(0, 0, 0);

            // To make sure the user is facing the right way show the arrows.
            m_GuiArrows.Show();

            // Turn off the fog whilst showing the intro.
            RenderSettings.fog = false;

            // Make sure the game is stopped for the flyer's health.
            m_HealthController.StopGame();

            // Since a selection slider is being used, hide the radial and show the reticle.
            m_SelectionSlider.gameObject.SetActive(true);
            m_SelectionRadial.Hide();
            m_Reticle.Show();
            m_FlyerMovementController.m_Speed = 70f;
            m_flyerPlayership.SetActive(false);



            // The user should hold Fire1 for the selection slider so turn on warnings for tapping.
            m_InputWarnings.TurnOnDoubleTapWarnings();
            m_InputWarnings.TurnOnSingleTapWarnings();

            // In order wait for the selection slider to fill, then the intro UI to hide, then the camera to fade out.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_UIController.HideIntroUI()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_IntroOutroFadeDuration, false)));

            // Once the screen has faded out, we can hide UI elements we don't want to see anymore like the arrows and reticle.
            m_GuiArrows.Hide();
            m_Reticle.Hide();

            // Turn the fog back on so spawned objects won't appear suddenly.
            RenderSettings.fog = true;

            // The user now needs to tap to fire so turn off the warnings.
            m_InputWarnings.TurnOffDoubleTapWarnings();
            m_InputWarnings.TurnOffSingleTapWarnings();

            // Now wait for the screen to fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_IntroOutroFadeDuration, false)));
        }
Ejemplo n.º 8
0
    // Use this for initialization
    IEnumerator Start()
    {
        m_Reticle.Show();

        m_Radial.Hide();

        yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeIn()));

        yield return(StartCoroutine(m_HowToUseSlider.WaitForBarToFill()));

        yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeOut()));

        SceneManager.LoadScene("Start Menu");
    }
Ejemplo n.º 9
0
        [SerializeField] private UIFader m_ReturnFader;                     // The final instructions are controlled using this fader.


        private IEnumerator Start()
        {
            m_Reticle.Show();

            m_Radial.Hide();

            // In order, fade in the UI on how to use sliders, wait for the slider to be filled then fade out the UI.
            yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeIn()));

            yield return(StartCoroutine(m_HowToUseSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeOut()));

            // Fade in the final UI.
            yield return(StartCoroutine(m_ReturnFader.InteruptAndFadeIn()));
        }
Ejemplo n.º 10
0
    IEnumerator ButtonActive()
    {
        yield return(new WaitForSeconds(timeToButton));

        button.SetActive(true);

        m_Reticle.Show();

        m_Radial.Hide();


        m_HowToUseConfirmSlider.OnBarFilled += LoadMenu;

        yield return(StartCoroutine(m_HowToUseConfirmFader.InteruptAndFadeIn()));

        yield return(StartCoroutine(m_HowToUseConfirmSlider.WaitForBarToFill()));

        yield return(StartCoroutine(m_HowToUseConfirmFader.InteruptAndFadeOut()));
    }
Ejemplo n.º 11
0
    IEnumerator BackToMenu()
    {
        m_Reticle.Show();

        m_Radial.Hide();

        yield return(StartCoroutine(m_Fader.InteruptAndFadeIn()));

        yield return(StartCoroutine(m_Slider.WaitForBarToFill()));

        yield return(StartCoroutine(m_Fader.InteruptAndFadeOut()));

        /*for (int i = 0; i < 10; i++) {
         *
         *      if (tempArray[i] != 0) {
         *
         *              highscoreName += letters[tempArray[i]];
         *      }
         * }
         *
         * highscoreName += chars[charCount].text;*/

        for (int i = 0; i < 10; i++)
        {
            if (chars[i].text != "-")
            {
                highscoreName += chars[i].text;
            }
        }

        if (highscoreName == "Debug")
        {
            clearHighscore();
        }
        else
        {
            PlayerPrefs.SetInt("highscore" + highscorePostion, totalTime);
            PlayerPrefs.SetString("highscoreName" + highscorePostion, highscoreName);
        }

        SceneManager.LoadScene("Start Menu");
    }
Ejemplo n.º 12
0
    private IEnumerator StartPhase()
    {
        // Wait for the intro UI to fade in.
        yield return(StartCoroutine(UIInteraction.ShowIntroUI()));

        // Show the reticle (since there is now a selection slider) and hide the radial.
        m_Reticle.Show();
        m_SelectionRadial.Hide();

        yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));


        // Wait for the selection slider to finish filling.
        //yield return StartCoroutine(m_SelectionSlider.WaitForBarToFill());

        // Wait for the intro UI to fade out.
        yield return(StartCoroutine(UIInteraction.HideIntroUI()));

        SceneManager.LoadScene("MathWorm", LoadSceneMode.Single);
    }
Ejemplo n.º 13
0
        private IEnumerator StartPhase()
        {
            // Wait for the instructions to fade in.
            yield return(StartCoroutine(m_InstructionsFader.InteruptAndFadeIn()));

            // Turn the reticle on and make it flat to the screen so it can be used with the selection slider.
            m_Reticle.Show();
            m_Reticle.UseNormal = false;

            // The user should hold Fire1 at this point so warn against tapping.
            m_InputWarnings.TurnOnDoubleTapWarnings();

            // Wait for the selection bar to fill indicating the user has read the instructions.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            // Turn off the double tap warnings since the user will need to use double tap to move the character.
            m_InputWarnings.TurnOffDoubleTapWarnings();

            // Wait for the instructions to fade out.
            yield return(StartCoroutine(m_InstructionsFader.InteruptAndFadeOut()));
        }
Ejemplo n.º 14
0
        [SerializeField] private SelectionSlider m_HowToUseSlider;          // This is the slider that is used to demonstrate how to use them.
        //   [SerializeField] private UIFader m_HowToUseConfirmFader;            // Afterwards users are asked to confirm how to use sliders in this UI.
        // [SerializeField] private SelectionSlider m_HowToUseConfirmSlider;   // They demonstrate this using this slider.
        //   [SerializeField] private UIFader m_ReturnFader;                     // The final instructions are controlled using this fader.


        private IEnumerator Start()
        {
            m_Reticle.Show();

            m_Radial.Hide();

            // In order, fade in the UI on how to use sliders, wait for the slider to be filled then fade out the UI.
            yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeIn()));

            yield return(StartCoroutine(m_HowToUseSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_HowToUseFader.InteruptAndFadeOut()));

            SceneManager.LoadScene("GameIntro");

            // In order, fade in the UI on confirming the use of sliders, wait for the slider to be filled, then fade out the UI.
            //     yield return StartCoroutine(m_HowToUseConfirmFader.InteruptAndFadeIn());
            //    yield return StartCoroutine(m_HowToUseConfirmSlider.WaitForBarToFill());
            //    yield return StartCoroutine(m_HowToUseConfirmFader.InteruptAndFadeOut());

            // Fade in the final UI.
            //    yield return StartCoroutine(m_ReturnFader.InteruptAndFadeIn());
        }
        private IEnumerator StartPhase()
        {
            // Wait for the intro UI to fade in.
            yield return(StartCoroutine(m_UIController.ShowIntroUI()));

            // Show the reticle (since there is now a selection slider) and hide the radial.
            m_Reticle.Show();
            m_SelectionRadial.Hide();

            // Turn on the tap warnings for the selection slider.
            m_InputWarnings.TurnOnDoubleTapWarnings();
            m_InputWarnings.TurnOnSingleTapWarnings();

            // Wait for the selection slider to finish filling.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            // Turn off the tap warnings since it will now be tap to fire.
            m_InputWarnings.TurnOffDoubleTapWarnings();
            m_InputWarnings.TurnOffSingleTapWarnings();

            // Wait for the intro UI to fade out.
            yield return(StartCoroutine(m_UIController.HideIntroUI()));
        }
Ejemplo n.º 16
0
        private IEnumerator StartPhase()
        {
            // Make sure the Outro UI is not being shown and the intro UI is.
            StartCoroutine(m_UIController.ShowIntroUI());
            StartCoroutine(m_UIController.HideOutroUI());

            // To make sure the user is facing the right way show the arrows.
            m_GuiArrows.Show();

            // Turn off the fog whilst showing the intro.
            RenderSettings.fog = false;

            // Make sure the game is stopped for the flyer's health.
            m_HealthController.StopGame();

            // Since a selection slider is being used, hide the radial and show the reticle.
            m_SelectionRadial.Hide();
            m_Reticle.Show();

            // In order wait for the selection slider to fill, then the intro UI to hide, then the camera to fade out.
            yield return(StartCoroutine(m_SelectionSlider.WaitForBarToFill()));

            yield return(StartCoroutine(m_UIController.HideIntroUI()));

            yield return(StartCoroutine(m_CameraFade.BeginFadeOut(m_IntroOutroFadeDuration, false)));

            // Once the screen has faded out, we can hide UI elements we don't want to see anymore like the arrows and reticle.
            m_GuiArrows.Hide();
            m_Reticle.Hide();

            // Turn the fog back on so spawned objects won't appear suddenly.
            RenderSettings.fog = true;

            // Now wait for the screen to fade back in.
            yield return(StartCoroutine(m_CameraFade.BeginFadeIn(m_IntroOutroFadeDuration, false)));
        }
    // Unity calls this function at the beginning
    private IEnumerator Start()
    {
        // Get the settings and store them into settings object
        settings = Settings.CreateFromJSON();
        API_KEY  = settings.api_key;
        LANG     = settings.lang;

        // Commented code above provides an opportunity to change questions dynamically with the given json file @given path

        /*
         *  WWW www = new WWW("file:///C:/Users/eminserdar.guzel/Desktop/icerik.json");
         *  WWW www = new WWW("file:///C:/Users/eda.mutlu/Desktop/icerik.json");
         *  yield return www;
         *  settings = JsonUtility.FromJson<Settings>(www.text);
         */

        // Reset the camera position
        ResetCameraPosition();

        // Make the intro text visible
        SetVisibile(introCanvas, true);

        if (Microphone.devices.Length <= 0)
        {
            Debug.Log("Microphone not connected!"); // Throw a warning message at the console if there isn't
            SetVisibile(micWarningText.gameObject, true);
        }

        // Wait for slider to be filled
        yield return(StartCoroutine(confirmButton.WaitForBarToFill()));

        SetVisibile(micWarningText.gameObject, false);

        // Make the intro objects invisible
        SetVisibile(introTimerText, true);
        SetVisibile(introText, false);
        SetVisibile(confirmButton.gameObject, false);

        // Countdown before entering the first room
        yield return(StartCoroutine(StartTimerWithText(introTimerText, introCountDownTime)));

        // Make the intro scene completely invisible
        SetVisibile(introCanvas, false);


        //

        foreach (Scene scene in settings.scenes)
        {
            ResetCameraPosition();

            /*
             * if (scene.name == "Bedroom") room = bedroom;
             * else if (scene.name == "Club") room = club;
             * else if (scene.name == "Kitchen") room = kitchen;
             * else room = living;
             */

            GameObject room = Resources.Load(scene.name) as GameObject;
            room = Instantiate(room, room.transform.position, Quaternion.identity);
            room.transform.SetParent(roomCollapser.transform);

            // Countdown in order to give some time to player to look around
            roomCountDownTime = scene.countdown_time;

            // Show remaining time
            SetVisibile(roomTimerText, true);
            yield return(StartCoroutine(StartRoomTimer(roomCountDownTime)));

            //Make invisble the timer and then the room
            SetVisibile(roomTimerText, false);
            Destroy(room);

            foreach (Question question in scene.questions)
            {
                questionText.text = question.description;
                result            = "";

                foreach (SelectionSlider button in answerButtons)
                {
                    Destroy(button.gameObject);
                }
                answerButtons.Clear();
                // Start room timer
                SetVisibile(roomTimerText, true);

                ResetCameraPosition();
                // Display the question
                SetVisibile(questionCanvas, true);
                questionCanvas.GetComponent <Animator>().SetTrigger("QuestionCanvasAnimation");
                questionCanvas.GetComponent <Animator>().SetTrigger("StopAnimation");
                SetVisibile(sttCorrectAnswer.gameObject, false);

                // If the question answer type is Speech To Text according to JSON file that we have given
                if (question.answer_type == "stt")
                {
                    SetVisibile(stt, true);

                    // The code block derived from http://answers.unity3d.com/questions/479064/microphone-detect-speech-start-end.html
                    // Check if there is at least one microphone connected
                    if (Microphone.devices.Length <= 0)
                    {
                        SetVisibile(roomTimerText, false);
                        Debug.Log("Microphone not connected!"); // Throw a warning message at the console if there isn't
                        SetVisibile(micWarningText.gameObject, true);
                        yield return(new WaitForSeconds(3.0f));

                        SetVisibile(micWarningText.gameObject, false);
                    }
                    else // At least one microphone is present
                    {
                        //Set 'micConnected' to true
                        micConnected = true;

                        //Get the default microphone recording capabilities
                        Microphone.GetDeviceCaps(null, out minFreq, out maxFreq);

                        // According to the documentation, if minFreq and maxFreq are zero, the microphone supports any frequency...
                        if (minFreq == 0 && maxFreq == 0)
                        {
                            //...Meaning 44100 Hz can be used as the recording sampling rate
                            maxFreq = 44100;
                        }

                        //Get the attached AudioSource component
                        goAudioSource = this.GetComponent <AudioSource>();

                        // Display mic image & recording text
                        SetVisibile(sttRecording, true);

                        // Ready to record
                        yield return(StartCoroutine(StartRecording(5)));

                        SetVisibile(roomTimerText, false);
                        // Store the resulting string of SpeechToText func.
                        this.mutex = false;
                        SpeechToText();


                        SetVisibile(sttRecording, false);
                        SetVisibile(sttProcessing, true);

                        while (!this.mutex)
                        {
                            yield return(new WaitForSeconds(0.5f));
                        }


                        SetVisibile(sttProcessing, false);

                        // Display the user's answer
                        sttAnswerText.text = result;
                        SetVisibile(sttAnswerText.gameObject, true);


                        // Check if the answer is correct or not
                        // ...Change the color of the text accordingly
                        if (result.ToLower() == question.correct_answer.ToLower())
                        {
                            correctAnswers     += 1;
                            sttAnswerText.color = Color.green;
                        }
                        else
                        {
                            falseAnswers       += 1;
                            sttAnswerText.color = Color.red;
                            // Display the correct answer
                            SetVisibile(sttCorrectAnswer.gameObject, true);
                            sttCorrectAnswer.text = "Doğru cevap: " + question.correct_answer.ToLower();
                        }

                        yield return(new WaitForSeconds(5.0f));

                        SetVisibile(sttAnswerText.gameObject, false);
                        SetVisibile(sttCorrectAnswer.gameObject, false);
                        SetVisibile(questionCanvas, false);

                        // Delete the .wav file used
                        // File.Delete(filePath);
                    }
                    SetVisibile(stt, false);
                }
                else
                {
                    int i            = 0;
                    int answersCount = question.answers.Count; // Total number of answers comes from JSON file
                    foreach (Answer answer in question.answers)
                    {
                        answerButtons.Add(Instantiate(buttonPrefab, BUTTON_POSITONS[answersCount - 2, i], Quaternion.identity)); // Create a new answer button for each answer and set position
                        answerButtons[i].transform.SetParent(questionCanvas.transform);                                          // Make the button's parent as question canvas
                        answerButtons[i].m_TrueAnswer = answer.correct;                                                          // To check whether the answer is correct, set the true or false according to JSON that we have given
                        answerButtons[i].GetComponentInChildren <Text>().text = question.answers.ElementAt(i).answer;            // Set the text of button according to JSON file
                        answerButtons[i].m_Feedback = question.has_feedback && question.answer_type == "multiple_choices" ? question.answers.ElementAt(i).feedback : "";
                        i++;
                    }

                    //Countdown to answer the given question
                    yield return(StartCoroutine(StartQuestionTimer(questionCountDownTime)));


                    int    index    = 0;
                    bool   flag     = false;
                    string feedback = "";
                    // Find the selected answer & it's index
                    foreach (SelectionSlider answerButton in answerButtons)
                    {
                        if (answerButton.m_BarFilled)
                        {
                            feedback = answerButtons[index].m_Feedback;
                            if (answerButton.m_TrueAnswer)
                            {
                                flag = true;
                                break;
                            }
                        }
                        index++;
                    }
                    // If one of the answers is selected and it's the correct one, increment the count of the correct answers.
                    // Otherwise, increment the count of the false answers
                    if (flag)
                    {
                        correctAnswers += 1;
                    }
                    else
                    {
                        falseAnswers += 1;
                    }

                    // Make the current question canvas and the timer invisible
                    SetVisibile(roomTimerText, false);
                    SetVisibile(questionCanvas, false);
                    yield return(new WaitForSeconds(1.0f));

                    if (question.has_feedback)
                    {
                        // Reset the camera position
                        ResetCameraPosition();
                        SetVisibile(feedbackCanvas, true);

                        if (question.fb_type == "text")
                        {
                            feedbackText.text = feedback;
                            SetVisibile(feedbackText.gameObject, true);

                            // Create an VR interactive button
                            SelectionSlider feedbackButton = Instantiate(buttonPrefab, new Vector3(0.0f, 70.0f, 60.0f), Quaternion.identity) as SelectionSlider;
                            feedbackButton.transform.SetParent(feedbackCanvas.transform);
                            feedbackButton.GetComponentInChildren <Text>().text = "Tamam!";

                            // When the feedback button has been filled, skip the feedback part
                            yield return(StartCoroutine(feedbackButton.WaitForBarToFill()));

                            SetVisibile(feedbackText.gameObject, false);
                            Destroy(feedbackButton.gameObject);
                        }
                        else if (question.fb_type == "video")
                        {
                            SetVisibile(screen, true);
                            SetVisibile(videoPlayer.gameObject, true);

                            /* To play the video full screen and near the camera
                             * GameObject camera = GameObject.Find("Camera");
                             * videoPlayer.renderMode = VideoRenderMode.CameraNearPlane;
                             */
                            //videoPlayer.url = feedback;

                            /*
                             * Following line of code is used for making it work in the android device as well
                             * feedback should be something like "mov_bbb.mp4" and it also should be located in the Resoursec directory
                             */
                            videoPlayer.clip = Resources.Load(feedback) as VideoClip;
                            videoPlayer.Play();

                            while (videoPlayer.isPlaying)
                            {
                                yield return(new WaitForSeconds(1.0f));
                            }

                            SetVisibile(videoPlayer.gameObject, false);
                            SetVisibile(screen, false);
                        }

                        SetVisibile(feedbackCanvas, false);
                    }
                    // Calculate total time spent while answering questions
                    totalTime   += timeToAnswer;
                    timeToAnswer = 0;
                }

                questionCanvas.GetComponent <Animator>().ResetTrigger("QuestionCanvasAnimation");
                questionCanvas.GetComponent <Animator>().ResetTrigger("StopAnimation");
            }

            // Make the question canvas invisible
            SetVisibile(questionCanvas, false);
            SetVisibile(sttAnswerText.gameObject, false);

            yield return(StartCoroutine(DisplayResults()));
        }
    }
    // Use this for initialization
    private IEnumerator Start()
    {
        playAudioCurrent.Play();
        standBody     = GameObject.Find("Body/StandBody");
        TVscreen      = GameObject.Find("_Level/TVscreen");
        faintBody     = GameObject.Find("Body/FaintBody");
        bareFaintBody = GameObject.Find("Body/BareFaintBody");
        bigPhone      = GameObject.Find("Phone/BigPhone");
        smallPhone    = GameObject.Find("Phone/SmallPhone");
        AED           = GameObject.Find("AED");
        nose          = GameObject.Find("TestText/Nose");
        neck          = GameObject.Find("TestText/Neck");
        shoulder      = GameObject.Find("TestText/Shoulder");
        cpr_Disrobe   = GameObject.Find("Body").transform.Find("FaintBody").gameObject.GetComponent <ClosedToBare>();
        middlePhone   = GameObject.Find("Phone/MiddlePhone");
        //cpr_Start = GameObject.Find("GUI").transform.Find("StartGUI").gameObject.GetComponent<UIFader>();
        //cpr_CheckAED = GameObject.Find("GUI").transform.Find("CheckAEDGUI").gameObject.GetComponent<UIFader>();
        //initialization
        if (standBody == null)
        {
            Debug.Log("MidTermProcManager : Can't find standing body!");
        }
        else
        {
            standBody.SetActive(true);
        }
        if (TVscreen == null)
        {
            Debug.Log("MidTermProcManager : Can't find TV screen!");
        }
        else
        {
            TVscreen.SetActive(false);
        }
        if (AED == null)
        {
            Debug.Log("MidTermProcManager : Can't find AED!");
        }
        else
        {
            AED.SetActive(true);
        }
        if (faintBody == null)
        {
            Debug.Log("MidTermProcManager : Can't find fainted body!");
        }
        else
        {
            faintBody.SetActive(false);
        }
        if (bareFaintBody == null)
        {
            Debug.Log("MidTermProcManager : Can't find bare fainted body!");
        }
        else
        {
            bareFaintBody.SetActive(false);
        }
        if (bigPhone == null)
        {
            Debug.Log("MidTermProcManager : Can't find big phone!");
        }
        else
        {
            bigPhone.SetActive(false);
        }
        if (smallPhone == null)
        {
            Debug.Log("MidTermProcManager : Can't find small phone!");
        }
        else
        {
            smallPhone.SetActive(true);
        }
        if (nose == null)
        {
            Debug.Log("MidTermProcManager : Can't find NoseText!");
        }
        else
        {
            nose.SetActive(false);
        }
        if (neck == null)
        {
            Debug.Log("MidTermProcManager : Can't find NeckText!");
        }
        else
        {
            neck.SetActive(false);
        }
        if (shoulder == null)
        {
            Debug.Log("MidTermProcManager : Can't find ShoulderText!");
        }
        else
        {
            shoulder.SetActive(false);
        }
        if (middlePhone == null)
        {
            Debug.Log("MidTermProcManager : Can't find middlephone!");
        }
        else
        {
            middlePhone.SetActive(false);
        }

        yield return(StartCoroutine(cpr_Start.InteruptAndFadeIn()));

        yield return(StartCoroutine(cpr_StartConfirm.WaitForBarToFill()));

        playAudioCurrent.clip = liuTwo;
        playAudioCurrent.Play();
        yield return(StartCoroutine(cpr_Start.InteruptAndFadeOut()));

        yield return(StartCoroutine(cpr_CheckAED.InteruptAndFadeIn()));

        yield return(StartCoroutine(cpr_AEDController.WaitForCheckingAED()));

        playAudioCurrent.clip = liuThree;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(4));

        yield return(StartCoroutine(cpr_LeftShoulderVisible.Show()));

        yield return(StartCoroutine(cpr_RightShoulderVisible.Show()));

        playAudioCurrent.clip = faintDetect;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(12));

        playAudioCurrent.clip = faintAnnounce;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(6));

        playAudioCurrent.clip = liuFour;
        playAudioCurrent.Play();
        yield return(StartCoroutine(cpr_CheckAED.InteruptAndFadeOut()));

        yield return(StartCoroutine(cpr_Dail.InteruptAndFadeIn()));

        yield return(StartCoroutine(cpr_SetPhone.SetPhone()));

        yield return(StartCoroutine(cpr_DailController.StartDailing()));

        yield return(StartCoroutine(cpr_PutDownPhone.PutItDown()));

        yield return(StartCoroutine(cpr_Dail.InteruptAndFadeOut()));

        playAudioCurrent.clip = liOne;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(2));

        /*playAudioCurrent.clip = liuFive;
         * playAudioCurrent.Play();
         * yield return new WaitForSeconds(13);
         * playAudioCurrent.clip = liTwo;
         * playAudioCurrent.Play();
         * yield return new WaitForSeconds(14);
         * playAudioCurrent.clip = liuSix;
         * playAudioCurrent.Play();
         * yield return new WaitForSeconds(7);
         * playAudioCurrent.clip = liThree;
         * playAudioCurrent.Play();
         * yield return new WaitForSeconds(5);
         * playAudioCurrent.clip = liFour;
         * playAudioCurrent.Play();
         * yield return new WaitForSeconds(7);*/
        yield return(StartCoroutine(cpr_CheckPerson.InteruptAndFadeIn()));

        yield return(StartCoroutine(cpr_NeckVisible.Show()));

        yield return(StartCoroutine(cpr_NoseVisible.Show()));

        playAudioCurrent.clip = liFive;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(16));

        yield return(StartCoroutine(cpr_PersonController.WaitForCheckingPerson()));

        yield return(StartCoroutine(cpr_CheckPerson.InteruptAndFadeOut()));

        yield return(StartCoroutine(cpr_Information.InteruptAndFadeIn()));

        playAudioCurrent.clip = liSix;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(9));

        playAudioCurrent.clip = liSeven;
        yield return(new WaitForSeconds(20));

        playAudioCurrent.Play();
        yield return(StartCoroutine(cpr_Disrobe.CheckBare()));

        noise.Stop();


        /*playAudioCurrent.clip = liEight;
         * playAudioCurrent.Play();
         * yield return new WaitForSeconds(10);*/
        playAudioCurrent.clip = liNine;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(10));

        playAudioCurrent.clip = liTen;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(4));

        playAudioCurrent.clip = liEleven;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(4));

        playAudioCurrent.clip = liTwelve;
        playAudioCurrent.Play();
        yield return(StartCoroutine(cpr_TrainController.LocomotionTracker()));

        playAudioCurrent.clip = count;
        playAudioCurrent.loop = true;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(30));

        playAudioCurrent.clip   = ambulance;
        playAudioCurrent.volume = 0;
        playAudioCurrent.Play();
        while (n < 1000)
        {
            playAudioCurrent.volume += 0.001f; ++n;
        }
        yield return(new WaitForSeconds(5));

        playAudioCurrent.loop = false;
        playAudioCurrent.clip = liuSeven;
        playAudioCurrent.Play();
        yield return(new WaitForSeconds(3));

        playAudioCurrent.clip = liFifteen;
        playAudioCurrent.Play();
        yield return(StartCoroutine(cpr_Information.InteruptAndFadeOut()));
        //Debug.Log ("111");
    }