private void GivePowerup() { switch (powerupType) { case Type.FallProtection: if (!_ps.hasFallProtection) { _ps.hasFallProtection = true; print("Given Fall Protection"); Destroy(gameObject); } break; case Type.Heal: if (_ps.health < _ps.maxHealth) { _ps.Heal(1); print("Given Health"); Destroy(gameObject); } break; case Type.SecondChance: if (!_ps.hasSecondChance) { _ps.hasSecondChance = true; print("Given Second Chance"); Destroy(gameObject); } break; case Type.Overcharge: if (!_ps.hasOvercharge) { _s.StartCoroutine(_s.Overcharge()); print("Given Overcharge"); Destroy(gameObject); } break; default: throw new ArgumentOutOfRangeException(); } }