Exemple #1
0
    void ClearGame()
    {
        if (clearOnoff)
        {
            StartCoroutine("waitTime2");

            Text[]      CleartextComponent = Cleartext.GetComponents <Text>();
            Score_sound clear_Sound        = CleartextComponent[0].GetComponent <Score_sound> ();
            clear_Sound.playSond();

            CleartextComponent[0].enabled = true;

            Back_Object.SetActive(true);
            StartCoroutine("waitTime3");
        }
    }
Exemple #2
0
    void Score()
    {
        if (scoreOnoff)
        {
            Text[]      clearGroup  = clear.GetComponentsInChildren <Text>();
            Score_sound clear_Sound = clearGroup[1].GetComponent <Score_sound> ();

            foreach (var objects in clearGroup)
            {
                objects.enabled = true;
            }

            if (score_c < 500)
            {
                score_c += Time.deltaTime * 600;

                clear_Sound.playSond();
            }
            else if (score_c > 500)
            {
                score_c = 500;
                clear_Sound.stopSond();
                clear_Sound.playSond2();

                StartCoroutine("waitTime4");
            }

            clearGroup[1].text = ((int)score_c).ToString("000");

            if (timeOnoff)
            {
                Text[]      timeGroup  = time.GetComponentsInChildren <Text> ();
                Score_sound time_Sound = timeGroup [1].GetComponent <Score_sound> ();

                foreach (var objects in timeGroup)
                {
                    objects.enabled = true;
                }

                if (score_t < 10 * timeBonus)
                {
                    score_t += Time.deltaTime * 3000;

                    time_Sound.playSond();
                }
                else if (score_t >= 10 * timeBonus)
                {
                    score_t = 10 * timeBonus;
                    time_Sound.stopSond();
                    time_Sound.playSond2();

                    StartCoroutine("waitTime5");
                }

                timeGroup[1].text = ((int)score_t).ToString("000000");
            }

            if (correctOnoff)
            {
                Text[]      correctGroup  = correct.GetComponentsInChildren <Text> ();
                Score_sound correct_Sound = correctGroup [1].GetComponent <Score_sound> ();

                foreach (var objects in correctGroup)
                {
                    objects.enabled = true;
                }

                if (correctScore == 0)
                {
                    StartCoroutine("waitTime7");
                    correct_Sound.playSond2();
                }

                if (score_m < 500 * correctScore)
                {
                    score_m += Time.deltaTime * 3000;

                    correct_Sound.playSond();
                }
                else if (score_m > 500 * correctScore)
                {
                    score_m = 500 * correctScore;
                    correct_Sound.stopSond();
                    correct_Sound.playSond2();

                    if (correctScore == waypoint)
                    {
                        StartCoroutine("waitTime6");
                    }
                    else
                    {
                        StartCoroutine("waitTime7");
                    }
                }

                correctGroup[1].text = ((int)score_m).ToString("000000");
            }

            if (perfectOnoff)
            {
                Text[]      parfectGroup  = perfect.GetComponentsInChildren <Text> ();
                Score_sound perfect_Sound = parfectGroup[1].GetComponent <Score_sound> ();

                foreach (var objects in parfectGroup)
                {
                    objects.enabled = true;
                }

                if (score_p < 10000)
                {
                    score_p += Time.deltaTime * 3000;

                    perfect_Sound.playSond();
                }
                else if (score_p > 10000)
                {
                    score_p = 10000;
                    perfect_Sound.stopSond();
                    perfect_Sound.playSond2();

                    StartCoroutine("waitTime7");
                }

                parfectGroup[1].text = ((int)score_p).ToString("000000");
            }

            if (totalScoreOnoff)
            {
                Text[]      scoreGroup    = score.GetComponentsInChildren <Text> ();
                Score_sound perfect_Sound = scoreGroup[1].GetComponent <Score_sound> ();
                perfect_Sound.playSond();
                foreach (var objects in scoreGroup)
                {
                    objects.enabled = true;
                }

                totalScore         = ((int)score_c) + ((int)score_t) + ((int)score_m) + ((int)score_p);
                scoreGroup[1].text = ((int)totalScore).ToString("0000000");


                //ハイスコア保持を保持
                if (LoadScene.Instance)
                {
                    if (LoadScene.Instance.highScore < (int)totalScore)
                    {
                        LoadScene.Instance.highScore = (int)totalScore;
                    }
                }

                StartCoroutine("restartWait");
            }


            if (restartOnoff)
            {
                Retry_Button.SetActive(true);
                Restart_Button.SetActive(true);
                Ranking_Button.SetActive(true);
            }
        }
    }