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; }
public void BuyItem(PowerupName item, int price) { CoinController.AmountOfCoins -= price; ItemsSold[(int)item] = true; GetComponent <Text>().text = "Coins: " + CoinController.AmountOfCoins; }
public bool IsPowerupActive(PowerupName powerup) { return(powerupsActive[(int)powerup]); }