void Start() { string HtmlText = GetHtmlFromUri("http://google.com"); if (HtmlText == "") { Debug.Log("Connection Not Found"); } else { if (PlayerPrefs.HasKey("normalHighscore")) { Highscores.AddNewHighscore(PlayerPrefs.GetString("player"), PlayerPrefs.GetInt("normalHighscore")); PlayerPrefs.SetInt("normalHighscore", 0); } if (PlayerPrefs.HasKey("casualHighscore")) { CasualHighscores.AddNewHighscore(PlayerPrefs.GetString("player"), PlayerPrefs.GetInt("casualHighscore")); PlayerPrefs.SetInt("casualHighscore", 0); } if (PlayerPrefs.HasKey("tonyHighscore")) { TonysHighscores.AddNewHighscore(PlayerPrefs.GetString("player"), PlayerPrefs.GetInt("tonyHighscore")); PlayerPrefs.SetInt("tonyHighscore", 0); } } }
void Update() { if (Input.GetKeyDown(KeyCode.Escape) || Input.GetButton("Cancel")) { if (score > 0) { PlayerPrefs.SetInt("casualScore", score); CasualHighscores.AddNewHighscore(username, score); } /* if (PlayerPrefs.HasKey("casualHighscore")) * { * if (PlayerPrefs.GetInt("casualHigscore") < PlayerPrefs.GetInt("casualScore")) * PlayerPrefs.SetInt("casualHighscore", PlayerPrefs.GetInt("casualScore")); * } * else * PlayerPrefs.SetInt("casualHighscore", score);*/ } }