1 Scene To Load All Levels??

I recently read that it is a good idea to have all of your levels in one scene, instead of each new level a new scene.

I want the same background for all my levels so this seems like a good idea.

What I’m confused about is, how would you go about doing this the right way?
It seems like if you keep adding levels to the scene the scene would become huge and take forever to load.

Does anyone know an effective way of doing this??

Thanks guys!

Creating a new scene for each level seems easy if you have a few level in your game. However, it looks like the brute-force way to do for many levels. The reason for being willing to create new scenes might be that it is easy to use the scene editor in unity to put gameobject components by dropping them in the scene. When you want to show all levels in one scene, you have to have some other structures to handle the changes in the levels. The first thing comes up to my mind is to create a “Level Builder” software. Then you can create each level with that builder. The builder must generate data including level component info and there must be an interface where your game loads the level according to that data.

Using one scene to play all levels generally means that you will define a data structure that describes your level and the scene will build the level using a specific set of data.

So, Imagine a simple game… you can only move forward, backward and jump. The only variation between level X and level Y is where the pits are placed.
Imagine that each pit is described by an X- Coord (pit start point) and a width value.

Now, each level can be described a a list of X/Width pairs. and a Goal X coord

When a level is loaded, give it access to that specific levels data and programatically build the level.

Here’s a cheap plugin for that…