示例#1
0
        static void Main(string[] args)
        {
            ScoreChecker sc = new ScoreChecker();

            sc.CheckScore();
            Console.ReadKey();
        }
示例#2
0
    void Awake()
    {
//		// clear high score manually
//		PlayerPrefs.DeleteAll ();

        Instance = this;

        // PlayerPrefs -> Stores and accesses player preferences between game sessions.
        // just for first time run the game, there is not a high score
        if (!PlayerPrefs.HasKey("HighScore"))
        {
            PlayerPrefs.SetInt("HighScore", 0);
        }

        ScoreText.text     = "0";
        HighScoreText.text = PlayerPrefs.GetInt("HighScore").ToString();
    }