I realized that performance for smartphones is something REALLY important, therefore while designing a game I came across many performance issues.
There are some gameObjects that are shared between various scenes. Is it better to use the load various scenes option or is it better to create prefabs of these elements and load them in each scene?
I have searched for performance about this but have not found any.
Is there a place specially about performances? How could I know more information about performance?
I mean, once the scene is loaded, there’s no difference between the loaded scene’s contents and the instantiated prefab’s contents, performance wise.
Loading a scene is slower, since it loads its contents from memory. A prefab loads from memory when a reference to it is loaded.
In other words, use scenes for big things, and prefabs for small things. You can also use Addressables to have more control over when assets are loaded from memory.
For UI and the like, in previous Unity releases I strongly preferred separate scenes because I found them a lot easier to work with. The new prefab workflow is pretty sick though, and makes them a lot more stable and harder to screw up.
Lost a bit of the ease of use, but makes up for it in making it suitable for stuff like more complex gui.
I believe Unity still has a 4GB limit on content referenced in a single scene. If you’re dealing with above 4GB of content then you should use the multiple scene approach.
To add to this, I suggest OP never load even close to 4GB in a single scene.
Even if you know you need 4GB of stuff, split it into multiple and load them additively and asynchronously. Its far less likely to cause problems that way, and gives you more fine grained control over loading such as being able to load certain things first easily, as well as provide progress reporting on loading to the user at a more fine grained level (think being able to say “loading props - 20% total progress - 80%” instead of just “loading 80%”