Exemplo n.º 1
0
        public void AddPowerUp(PowerUp powerUp)
        {
            PowerUp duplicatedPowerUp = _activePowerUps.Find(x => x.GetType() == powerUp.GetType());

            if (duplicatedPowerUp == null)
            {
                powerUp.OnPickedItem();
                _activePowerUps.Add(powerUp);
            }
            else
            {
                powerUp.DuplicatedPowerUp(duplicatedPowerUp);
                powerUp.DestroyPowerUp();
            }
        }
Exemplo n.º 2
0
 public void RemovePowerUp(PowerUp powerUp)
 {
     _activePowerUps.Remove(powerUp);
     powerUp.DestroyPowerUp();
 }