public void SaveScore()
    {
        string p1string = p1Name.text;
        string p2string = p2Name.text;

        if (p1string.Length < 1)
        {
            p1string = "player1";
        }

        if (p2string.Length < 1)
        {
            p2string = "player2";
        }

        RankingManager.UpdateRanking(p1string, p1, p2string, p2);
        RankingManager.SaveRanking();
    }
Exemple #2
0
    IEnumerator ResultAnim()
    {
        isPlayGame      = false;
        player.canInput = false;

        //スコアの計算
        score = CalcScore();

        yield return(new WaitForSeconds(2));

        //リザルトを表示
        resultPanel.gameObject.SetActive(true);

        if (player.isDeath)
        {
            AudioManager.Play(SEType.Game_Over);
        }
        else
        {
            AudioManager.Play(SEType.Clear_Goal);
        }



        //順位発表
        RankingManager.LoadRanking();
        RankingManager.SetRankData(score);
        RankingManager.SaveRanking();

        //スコアをアニメーション
        yield return(StartCoroutine("ScoreCount", 5f));       //早さ

        var rank = RankingManager.GetRank(score);

        if (rank < 3)
        {
            rankImage.enabled = true;
            rankImage.sprite  = rankSprList[rank];
        }
    }