Will using AddComponent frequently lower performance?

I’m creating a Scrolling Shooter/Shmup RPG that will be using a lot of unique enemies. I currently have an Event Director scripted that controls the spawning of enemies and objects. To speed things up in the long run, I was thinking about scripting a system that will use AddComponent to create unique enemies at run-time. I’d be adding various Movement and Combat scripts to a single prefab, which all enemies would derive from. In the long run, this would make creating new enemies an extremely fast process.

Now, before I decide to code the system… I’m wondering how much of an impact on performance this might make, as compared to making a ton of predefined enemies.

Example:

  1. Instantiate enemy prefab
  2. Modify common enemy values
  3. Add move script (Various curves, linear paths, and staged events)
  4. Modify values
  5. Add combat script (Various bullet patterns)
  6. Modify values

Well to start with instantiating at run time is a bit expensive in terms of performance and yes doing your own AddComponent isn’t exactly brilliant either. How about you add all of the components to a prefab, instantiate a pool of (say) 20 enemies and then configure them by enabling and disabling the components that have been added - then your runtime performance would be much better and you should get the same result.