public void Load_Highscore() { PlayerDataHighscore loadedDataHighscore = SaveLoadHighscore.LoadPlayer(); highscore = loadedDataHighscore.highscore; Highscore.text = highscore.ToString("F0"); }
public void GameEnded() { AdManager.AdManage.bannerView.Destroy(); Revive_Panel.SetActive(false); GameOver_Panel.SetActive(true); game_over = false; //game_over_menu = true; Calculate_Coin(); Save_Coin(); Score_UI.text = Movement.ins.score.ToString("F0"); Coin_UI.text = current_coins.ToString("F0"); PlayerDataHighscore loadedDataHighscore = SaveLoadHighscore.LoadPlayer(); var temp_highscore = loadedDataHighscore.highscore; if (Movement.ins.score > temp_highscore) { Score_Text.text = "NEW HIGHSCORE"; PlayerDataHighscore SaveDataHighscore = new PlayerDataHighscore(); SaveDataHighscore.highscore = Movement.ins.score; SaveLoadHighscore.SavePlayer(SaveDataHighscore); } else { Score_Text.text = "HIGHSCORE"; } }