public void MiseAJourScore(TPS tps) { List <TPS> superieur = new List <TPS>(); List <TPS> inferieur = new List <TPS>(); for (byte i = 0; i < twitchPlayerScore.Length; i++) { if (twitchPlayerScore[i].GetScore() > tps.GetScore()) { superieur.Add(twitchPlayerScore[i]); } else if (twitchPlayerScore[i].GetScore() < tps.GetScore()) { inferieur.Add(twitchPlayerScore[i]); } } for (byte i = 0; i < twitchPlayerScore.Length; i++) { if (i < superieur.Count) { twitchPlayerScore[i] = superieur[i]; } if (i == superieur.Count) { twitchPlayerScore[i] = tps; } if (i > superieur.Count) { twitchPlayerScore[i] = inferieur[i - (superieur.Count + 1)]; } } MiseAJourScoreText(); }
IEnumerator AddScore() { while (true) { playerScore.SetScore(playerScore.GetScore() + 5); yield return(new WaitForSeconds(1f)); } }