示例#1
0
    void GameOver(int type)
    {
        int score = scoreController.CheckScore;

        if (score > highscore)
        {
            highscore = score;
            SaveLoadController.SaveScore(highscore);
        }
        if (type == 1)
        {
            gameOverPanel.GetComponentInChildren <Text>().text = "You Won\nScore: " + score + "\nHighscore: " + highscore;
        }
        else
        {
            gameOverPanel.GetComponentInChildren <Text>().text = "You Lost\nScore: " + score + "\nHighscore: " + highscore;
        }

        gameOverPanel.SetActive(true);
        Time.timeScale = 0;
    }