private void Show() { float score = game.ScoreGame; //Load current score transform.Find("TxtScoreObtained").GetComponent <Text>().text = "VOUS AVEZ EU " + (int)score + " POINTS"; //Give score ScoreSI.SetScore(game.ScoreGame); //Update table ScoreSI.UpdateHighscore(); //Load highscore string highscore = ScoreSI.GetHighScore().ToString(); for (int i = 1; i < 5; i++) { highscore += "\n" + ScoreSI.GetHighScore(i).ToString(); } transform.Find("TxtScore").GetComponent <Text>().text = highscore; string highscorePseudo = ScoreSI.GetHighScorePseudo().ToString(); for (int i = 1; i < 5; i++) { highscorePseudo += "\n" + ScoreSI.GetHighScorePseudo(i).ToString(); } transform.Find("TxtPseudo").GetComponent <Text>().text = highscorePseudo; gameObject.SetActive(true); }
private void Show() { //Play sound //SoundsManager.PlaySound(SoundsManager.Sound.gameOver); string spaceInvadersPseudo = ""; string spaceInvadersScore = ""; string snakePseudo = ""; string snakeScore = ""; string pseudo = ""; for (int i = 0; i < 10; i++) { pseudo = Score.GetHighScorePseudo(i); if (pseudo.Length != 10) { for (int j = pseudo.Length; j <= 10; j++) { pseudo += " "; } } snakePseudo += (i + 1) + ". " + pseudo + System.Environment.NewLine; } for (int i = 0; i < 10; i++) { snakeScore += Score.GetHighScore(i) + System.Environment.NewLine; } for (int i = 0; i < 10; i++) { //pseudo = Score.GetHighScorePseudo(i); if (pseudo.Length != 10) { pseudo = ScoreSI.GetHighScorePseudo(i); for (int j = pseudo.Length; j <= 10; j++) { pseudo += " "; } } spaceInvadersPseudo += (i + 1) + ". " + pseudo + System.Environment.NewLine; } for (int i = 0; i < 10; i++) { spaceInvadersScore += ScoreSI.GetHighScore(i) + System.Environment.NewLine; } //Score Space Invader transform.Find("Ranking/SpaceInvadersRank/SpaceInvadersPseudo").GetComponent <Text>().text = spaceInvadersPseudo; transform.Find("Ranking/SpaceInvadersRank/SpaceInvadersScore").GetComponent <Text>().text = spaceInvadersScore; //Score snake transform.Find("Ranking/SnakeRank/SnakePseudo").GetComponent <Text>().text = snakePseudo; transform.Find("Ranking/SnakeRank/SnakeScore").GetComponent <Text>().text = snakeScore; gameObject.SetActive(true); }
private void Awake() { audiosource = GetComponent <AudioSource>(); playerController = GameObject.Find("Player").GetComponent <PlayerController>(); wave = GameObject.Find("Wave").GetComponent <Wave>(); livesSlots = GameObject.Find("TxtLives").GetComponent <LivesSlots>(); txtLevel = GameObject.Find("TxtLevel").GetComponent <Text>(); txtScore = GameObject.Find("TxtScore").GetComponent <Text>(); txtHighScore = GameObject.Find("TxtHighScore").GetComponent <Text>(); txtHighScore.text = "MEILLEUR SCORE < " + ScoreSI.GetHighScore(0).ToString() + " >"; }
private void ShowUpdated() { //Load current score transform.Find("TxtScoreObtained").GetComponent <Text>().text = "VOUS AVEZ EU " + game.ScoreGame; //Load highscore string highscore = ScoreSI.GetHighScore().ToString(); for (int i = 1; i < 5; i++) { highscore += "\n" + ScoreSI.GetHighScore(i).ToString(); } transform.Find("TxtScore").GetComponent <Text>().text = highscore; string highscorePseudo = ScoreSI.GetHighScorePseudo().ToString(); for (int i = 1; i < 5; i++) { highscorePseudo += "\n" + ScoreSI.GetHighScorePseudo(i).ToString(); } transform.Find("TxtPseudo").GetComponent <Text>().text = highscorePseudo; }
private void Awake() { transform.Find("TxtHighscore").GetComponent <Text>().text = "MEILLEUR SCORE : " + ScoreSI.GetHighScore(0).ToString(); }
private void Show() { //Play sound //SoundsManager.PlaySound(SoundsManager.Sound.gameOver); //Score Space Invader transform.Find("Score").Find("SpaceScoreText").GetComponent <Text>().text = "MEILLEUR SCORE :\n" + ScoreSI.GetHighScorePseudo(0) + " - " + ScoreSI.GetHighScore(0); //Score snake transform.Find("Score").Find("SnakeScoreText").GetComponent <Text>().text = "MEILLEUR SCORE :\n" + Score.GetHighScorePseudo(0) + " - " + Score.GetHighScore(0); gameObject.SetActive(true); }