コード例 #1
0
        public void CheckHighscore()
        {
            float highscore = ScoreSavingSysytem.ReadHighscore();

            if (highscore < 0f)
            {
                textField.text = "Highscore:\nNo games finished yet!";
            }
            else
            {
                string minutes     = ((int)highscore / 60).ToString();
                string seconds     = (highscore % 60).ToString("00");
                string miliseconds = ((highscore * 100) % 100).ToString("00");

                textField.text = "Highscore:\n" + minutes + ":" + seconds + ":" + miliseconds;
            }
        }
コード例 #2
0
        public void EndGameActions()
        {
            tickTime = false;
            gameOverMessage.GetComponent <Text>().text += "\n" + minutes + ":" + seconds + ":" + miliseconds;
            coroutineRunner.StartCoroutine(ActivateEndButtonDelayed());
            float latestTime = time;

            if (ScoreSavingSysytem.ReadHighscore() < latestTime)
            {
                ScoreSavingSysytem.SaveHighscore(latestTime);
                gameOverMessage.GetComponent <Text>().text += "\nNew highscore!";
            }
            else
            {
                gameOverMessage.GetComponent <Text>().text += "\nBetter luck next time!";
            }
            gameOverMessage.SetActive(true);
        }
コード例 #3
0
 void ClickActionReset()
 {
     ScoreSavingSysytem.SaveHighscore(-1f);
     highscoreDisplay.GetComponent <HighscoreDisplay>().CheckHighscore();
 }