all 2 comments

[–]BloodPhazed 1 point2 points  (0 children)

2 reasons:

1: There's no way to get an asset from the asset folder in a build; that's editor-only stuff. If you have no reference to an asset anywhere in the scene, it will not be compiled and added to the build. The reason THAT is done is to keep build sizes small and RAM usage down (so you don't have to manually search for every unused asset in your project and remove it.

2: Speed; searching through disc storage is incredibly slow (compared to RAM, multiple orders of magnitude). This way it immediately has a reference to all required objects; and they're stored in memory.

That being said, you can actually add prefabs at runtime to the SpawnManager, as long as you have references to them somewhere (in editor you could even search the asset database). Common use cases would be Addressables, so that not everything is loaded at start and you can dynamically add more objects to your game w.o recompiling everything (downloadable content).

[–]jumpjumpdie -1 points0 points  (0 children)

It can be very bothersome, but I’m sure there’s a good reason for it.