コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Sended)
        {
            _ssData.SaveData(gameMode, MaxMode, Score, MaxScore);
            Sended = false;

            StartCoroutine("CloseWindow");
        }
    }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: hagayataka7/Poker
    IEnumerator GameEnd()
    {
        Rank rank = Valuation(player.PlayerPoint);

        seve.SaveData(0, 1, (int)rank, 7);
        yield return(new WaitForSeconds(0.01f));

        EndMessageBox.SetActive(true);
        EndText.text = "最終所持ポイントは" + player.PlayerPoint + "です\n" +
                       "今回のランクは" + rank.ToString() + "です";
        for (; ;)
        {
            if (Input.GetKey(KeyCode.Space) || Input.GetKeyDown(KeyCode.JoystickButton1))
            {
#if UNITY_EDITOR
                EditorApplication.isPlaying = false;
#elif UNITY_STANDALONE
                Application.Quit();
#endif
            }
            yield return(null);
        }
    }
コード例 #3
0
    //ゲームオーバーの処理
    IEnumerator GameOver()
    {
        one = false;
        gameoverObj.SetActive(true);
        //gameoverに一回だけする処理
        if (one3 == true)
        {
            //スコアのバーの最大値
            barnum = janken.score / 35.0f;
            //メインのBGMをミュートに
            MainBGM.mute = true;

            //ゲージの増加処理
            for (; ;)
            {
                scoreSlider.value += 0.001f;
                //スコアバーが最大値になったら
                if (scoreSlider.value >= barnum)
                {
                    scoreSlider.value = barnum;
                    geageMax          = true;
                    if (scoreSlider.value * 35.0f <= 0)
                    {
                        T_gameover_text.text = "Worst";
                    }
                    break;
                }
                //1~10
                if (scoreSlider.value * 35.0f <= 10)
                {
                    T_gameover_text.text = "Worst";
                    sliderfill.color     = new Color(155f / 255f, 0f / 255f, 255f / 255f, 255f / 255f);
                    scoreEND             = 0;
                }
                //11~20
                else if (scoreSlider.value * 35.0f <= 20)
                {
                    T_gameover_text.text = "Bad";
                    sliderfill.color     = new Color(0f / 255f, 0f / 255f, 255f / 255f, 255f / 255f);
                    scoreEND             = 1;
                }
                //21~25
                else if (scoreSlider.value * 35.0f <= 25)
                {
                    T_gameover_text.text = "Good";
                    sliderfill.color     = new Color(40f / 255f, 255f / 255f, 0f / 255f, 255f / 255f);
                    scoreEND             = 2;
                }
                //26~34
                else if (scoreSlider.value * 35.0f <= 34)
                {
                    T_gameover_text.text = "Great";
                    sliderfill.color     = new Color(255f / 255f, 69f / 255f, 0f / 255f, 255f / 255f);
                    scoreEND             = 3;
                }
                //35~
                else if (scoreSlider.value * 35.0f <= 100000)
                {
                    T_gameover_text.text = "Excellent";
                    sliderfill.color     = new Color(255f / 255f, 255f / 255f, 0f / 255f, 255f / 255f);
                    scoreSlider.value    = 1.0f;
                    geageMax             = true;
                    scoreEND             = 4;
                    break;
                }
                yield return(null);
            }
            //BGMを変える処理
            GameOverBGM.mute = false;
            GameOverBGM.time = 0f;
            one3             = false;
        }

        int score = janken.score;

        gameover_score.SetActive(true);
        scoretext.text = "" + score;

        //スコアをテキストに起こす処理
        SSDataControl.SaveData(0, 1, scoreEND, 5);

        yield return(new WaitForSeconds(1.5f));

        //ハイスコア更新されたとき
        if (janken.highScoreUP == true)
        {
            if (one2 == true)
            {
                SE.PlayOneShot(HiscoreClip);
                one2 = false;
                kamief.SetActive(true);
            }
            hiscoreObj.SetActive(true);
        }

        gameoverEnd = true;
    }