Exemple #1
0
    public void AddScore(float points)
    {
        score         += points;
        scoreText.text = "Score: " + score;

        shieldScore  -= points;
        cannonScore  -= points;
        torret1Score -= points;
        torret2Score -= points;

        if (shieldScore <= 0)
        {
            puCtrl.ActivateShield();
            shieldScore = 40f;
        }
        if (cannonScore <= 0)
        {
            puCtrl.ActivateCannon();
            cannonScore = 50f;
        }
        if (torret1Score <= 0)
        {
            puCtrl.ActivateTorret1();
            shieldScore = 60f;
        }
        if (torret2Score <= 0)
        {
            puCtrl.ActivateTorret2();
            shieldScore = 70f;
        }
    }