Exemplo n.º 1
0
    public void ActivatePowerup(PowerupName powerUp, float duration)
    {
        if (!powerupsActive[(int)powerUp])
        {
            powerupsActive[(int)powerUp] = true;
            switch (powerUp)
            {
            case PowerupName.SPEED:
                ActivateSpeedPowerup();
                break;

            case PowerupName.LANE:
                ActivateLanePowerup();
                break;

            case PowerupName.SHIELD:
                ActivateShieldPowerup();
                break;

            case PowerupName.MAGNET:
                ActivateMagnetPowerup();
                break;
            }
        }

        durations[(int)powerUp] += duration;
    }
Exemplo n.º 2
0
 public void BuyItem(PowerupName item, int price)
 {
     CoinController.AmountOfCoins -= price;
     ItemsSold[(int)item]          = true;
     GetComponent <Text>().text    = "Coins: " + CoinController.AmountOfCoins;
 }
Exemplo n.º 3
0
 public bool IsPowerupActive(PowerupName powerup)
 {
     return(powerupsActive[(int)powerup]);
 }