Creating Modular Power-Up Systems
For things like power-ups which usually appear in many different forms, making a script for each type is very inefficient.
Modularity is the solution.
A Speed Boost Power-up:
Let’s make it modular!
In this implementation, I am passing the PowerupType _type variable and the float _duration variable to functions called ActivatePowerup(PowerupType, Float) which exist in the components that each power-up should effect.
This is not the only way to do it, but it works for my current project.