i think this is an ok start, but some issues that stand out to me:
- this system means that deprecating a powerup will leave gaps in your switch statement. like if we no longer want to support SpeedBoost, then powerup id 1 will just sit there, potentially unused, potentially causing a bug
- each powerup you create will contain all of the logic for triggering all powerups. that means that if you want to tweak say, AmmoUp, then you've got to go through all of your PowerUp script to find the section that deals specifically with AmmoUp. alternatively, if you move all the logic to the player, that means that this player script will need to know how to implement every single power up, which i think is also cumbersome and hard to scale.
i'd suggest making each power up be able to affect a passed player argument, so that you can have your power up code nicely isolated and easier to maintain.