public void ActivatePowerUp(PowerUp powerUp) { if (powerUp.overwrite) { activePowerup?.Remove(this); activePowerup = powerUp; timer = powerUp.duration; duration = powerUp.duration; powerupSlider.value = 1f; } powerUp.Apply(this); }
public PowerUp GetPowerUp(GameObject go) { powerUp.Apply(go); Destroy(this.gameObject); return(powerUp); }