Modular development is a huge part of software design. Updates, Downloadable Content, Expansions, Sequels, or just continued development of a project will all see the benefit and use of modular systems.
These systems are “Modular” because they are made with the intent to be added onto or changed throughout development in order to fit the needs of the various parts of the project.
So why would anyone want to make a powerup system that is modifiable? Well, that’s easy. What if the developers wanted to add in another powerup later on? Or maybe they find that the powerups you are currently using should be changed or replaced with something that works better for that game? Either way, you will need to have something set up to easily add or remove parts of your system on the fly.
So how do you do this?
One option is to use if statements along with an “Integer” type variable. Just make it serializable and set each powerup to a different ID in the inspector.
Another option is to use a “Switch” statement.