private void SetupMultiPlayer(int highestScore) { for (int i = 0; i < Scores.Count; i++) { if (Scores[i] > 0) { ScoreBar temp = Instantiate(ScoreBarBase, P_Scoring.transform).GetComponent <ScoreBar>(); temp.SetNewBarColour(PlayerColourContainer.GetPlayerColour(i + 1)); temp.Begin(Scores[i], (float)Scores[i] / (float)highestScore, BarRiseAnimationTime, Scores[i] > Highscore && Scores[i] == highestScore, Scores[i] == highestScore, 0.1f); } } }
private void SetupSinglePlayer(int playerNr) { int highestScore; if (Scores[playerNr] > Highscore) { highestScore = Scores[playerNr]; } else { highestScore = Highscore; } ScoreBar temp = Instantiate(ScoreBarBase, P_Scoring.transform).GetComponent <ScoreBar>(); temp.SetNewBarColour(PlayerColourContainer.GetPlayerColour(playerNr + 1)); temp.Begin(Scores[playerNr], (float)Scores[playerNr] / (float)highestScore, BarRiseAnimationTime, Scores[playerNr] > Highscore, Scores[playerNr] > Highscore, 0.1f); temp = Instantiate(ScoreBarBase, P_Scoring.transform).GetComponent <ScoreBar>(); temp.SetNewBarColour(PlayerColourContainer.GetPlayerColour(0)); temp.Begin(Highscore, (float)Highscore / (float)highestScore, BarRiseAnimationTime, false, false, 0.1f); }