Exemplo n.º 1
0
 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.Highscores[_LevelIndex])
        {
            highestScore = Scores[playerNr];
        }
        else
        {
            highestScore = _Highscore.Highscores[_LevelIndex];
        }
        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.Highscores[_LevelIndex], Scores[playerNr] > _Highscore.Highscores[_LevelIndex], 0.1f);

        temp = Instantiate(ScoreBarBase, P_Scoring.transform).GetComponent <ScoreBar>();
        temp.SetNewBarColour(PlayerColourContainer.GetPlayerColour(0));
        temp.Begin(_Highscore.Highscores[_LevelIndex], (float)_Highscore.Highscores[_LevelIndex] / (float)highestScore, BarRiseAnimationTime, false, false, 0.1f);
    }
Exemplo n.º 3
0
    private void SetupSinglePlayer(int playerNr, bool _TimeGame)
    {
        int highestScore;

        if (_TimeGame == false)
        {
            if (Scores[playerNr] > Highscore)
            {
                highestScore = Scores[playerNr];
            }
            else
            {
                highestScore = Highscore;
            }
        }
        else if (_TimeGame == true && Highscore != 0)
        {
            if (Scores[playerNr] < Highscore)
            {
                highestScore = Scores[playerNr];
            }
            else
            {
                highestScore = Highscore;
            }
        }
        else
        {
            highestScore = Scores[playerNr];
        }
        ScoreBar temp = Instantiate(ScoreBarBase, P_Scoring.transform).GetComponent <ScoreBar>();

        temp.SetNewBarColour(PlayerColourContainer.GetPlayerColour(playerNr + 1));
        if (_TimeGame == true && Highscore != 0)
        {
            if (Scores[playerNr] < highestScore)
            {
                temp.Begin(Scores[playerNr], (float)Scores[playerNr] / (float)highestScore, BarRiseAnimationTime, Scores[playerNr] < Highscore, Scores[playerNr] < Highscore, 0.1f);
            }
            else
            {
                temp.Begin(Scores[playerNr], (float)highestScore / (float)Scores[playerNr], BarRiseAnimationTime, Scores[playerNr] < Highscore, Scores[playerNr] < Highscore, 0.1f);
            }
        }
        else if (highestScore != 0)
        {
            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));
        if (_TimeGame == false && Highscore != 0)
        {
            temp.Begin(Highscore, (float)Highscore / (float)highestScore, BarRiseAnimationTime, false, false, 0.1f);
        }
        else if (Highscore != 0)
        {
            if (Scores[playerNr] < highestScore)
            {
                temp.Begin(Highscore, (float)Highscore / (float)highestScore, BarRiseAnimationTime, false, false, 0.1f);
            }
            else
            {
                temp.Begin(Highscore, (float)highestScore / (float)Highscore, BarRiseAnimationTime, false, false, 0.1f);
            }
        }
    }