Example #1
0
    public void AddScore(string type)
    {
        if (thisPlayer != null)
        {
            if (type == "Red")
            {
                totalScore       += baseScore * 1;
                thisPlayer.money += baseMoney * 1;
                Red++;
            }
            else if (type == "Blue")
            {
                totalScore       += baseScore * 2;
                thisPlayer.money += baseMoney * 2;
                Blue++;
            }
            else if (type == "Green")
            {
                totalScore       += (int)(baseScore * 1.5f);
                thisPlayer.money += (int)(baseMoney * 1.5f);
                Green++;
            }
            else if (type == "Gold")
            {
                totalScore       += baseScore * 3;
                thisPlayer.money += baseMoney * 3;
                Gold++;
            }
            else if (type == "Rainbow")
            {
                totalScore       += baseScore * 10;
                thisPlayer.money += baseMoney * 10;
                Rainbow++;
            }
            else if (type == "Escaped")
            {
                Escaped++;
            }
            else
            {
            }
            waveEnemies--;


            if (waveEnemies == 0)
            {
                spawnSystem.NextWaveSetup();
            }


            thisPlayer.thisUI.UpdateScore();
            thisPlayer.thisUI.UpdateMoney();
        }

        scoreBoard.UpdateKills();
    }