예제 #1
0
    public void GetScore(int score)
    {
        NowScore += score;
        if (NowScore > BestScore)
        {
            BestScore = NowScore;
        }

        nowScore.text       = NowScore.ToString();
        bestScore.text      = BestScore.ToString();
        nowScoreClear.text  = NowScore.ToString();
        bestScoreClear.text = BestScore.ToString();
    }
예제 #2
0
    public void SetScore(int level, Text best, Text now, Text bestClear, Text nowClear)
    {
        levelNow       = level;
        bestScore      = best;
        nowScore       = now;
        bestScoreClear = bestClear;
        nowScoreClear  = nowClear;

        BestScore      = PlayerPrefs.GetInt("Level" + levelNow.ToString(), 0);
        NowScore       = 0;
        nowScore.text  = NowScore.ToString();
        bestScore.text = BestScore.ToString();
    }
예제 #3
0
    public void ScoreUp()
    {
        //자신의 최대 치를 자신의 위치를 비교하여 스코어를 올림
        if (scoreKeep < (int)player.transform.position.z)
        {
            scoreKeep = (int)player.transform.position.z;

            Score++;
        }

        // 클릭 카운트가 베스트클릭카운트보다 높을시 갱신
        if (Score > BestScore)
        {
            BestScore = Score;

            uiPanel.bestClickScore.text = "TOP : " + BestScore.ToString();
        }
        // 클릭 카운트 표시
        uiPanel.clickScore.text = Score.ToString();

        // 베스트클릭 점수 저장
        PlayerPrefs.SetInt("BESTSCORE", BestScore);
    }