I’m new in Unity. I have to make an app to my company. It is a game with different scenes.
I am looking into the way of building the project, because of many shared resources.
Firstly, I thought of creating different scenes and add those additively to a main scene, where would be the shared prefabs.
But, someone suggested me to create a prefab as a scene. And have many prefabs as scene I need. Create and destroy it whenever you need it. Keeping only one scene in your project.
What do you recommend me?
What are the pros and contras of doing that?
The nice things about using actual scenes instead of loading prefabs is that you can load them asynchronously - so if they’re a bit big, you don’t have to get a lag on scene load. The editor is also much more helpful in showing you one scene at a time, so multi-scene editing is easier with scenes than with prefabs.
The downside is that the API for loading scenes is a bit harder to work with than simply instantiating and destroying objects. The API is also fairly new (how you load scenes in Unity was changed somewhat recently), so there’s still some lingering bugs.
There’s some things - like light settings and navmeshes and whatnot - that are tied to their scene, so if you need to ie. have different light settings on different levels, you should go with scenes.
Another thing to note about prefabs is that Unity doesn’t support nested prefabs, although there are some Asset Store products that add this capability to one degree or another.
This is another argument for not making your entire scene into a single prefab. You’ll lose the prefab advantages of the individual entities in your scene. Ideally your scene will contain only prefab instances and possibly empty GameObjects used as “folders” to organize those prefab instances.