I am working on a game in Unity with many levels(around 200). However, sometimes I find myself wanting to add a new feature or a new object to every level. The problem with this is that my levels are each an individual scene. So if I wish to add a new feature I have to create a prefab and drag and drop it into every level, this is very tedious as most of my ideas come later in game development. Is there a way to quickly add a prefab to every scene or multiple scenes at once in Unity?
CodePudding user response:
You need to create an Spawner class that doesn't get destroyed between scenes. So you can add it to wone then just call it to spawn an entity. Also if you have 200 levels, then you might want to think about auto-generating your scenes.
CodePudding user response:
My design pattern is I have a single Prefab that I've put in all scenes, and when I have new things to add to all scenes, I add them as children of that single prefab. If you need it to be a top-level object, you can put something in its script that unparents itself on Awake.