Persistent scenes

Is there a quck and easy way to have a scene remain loaded or reload to its previous state? Like a world map or a main menu screen that you’d need to travel back and forth between.

Something like…

function Start(){ DontDestoryOnLoad();}

…will make a gameObject persistent

now all you need is logic that says if the level
= “map level” turn the map on else turn it off.

Cheers,

For something that you switch back and forth a lot, I’d be inclined not to have it be a separate scene at all, but rather some stuff that’s on another layer and then swap cameras or something along those lines.

–Eric

I dont know if its help or not, but my project game sequence goes>

Load splash, Just audio and pic,
Load start, with level assets, and dont destroy on load on most,

Then the remaining levels contain the active dynamic parts, which are different for each level.

The game goes between all levels except splash and start (see above)
But goes to one called start02, whict resembles start, but has not the level assets.
hth
AC

You can make anything DontDestroyOnLoad and then make it inactive (when you want it to disappear and stop rendering) then active again when you want it back. I would guess that’s the “Unity way” of doing persistent objects.

AFAIK there is no “Unity way” for making objects persistent between application launches, however … a significant issue. 2.0?

DontDestroyOnQuit!

Serializing the object (if it is only an object)

Is that the “Unity Way” or the “Mono Way”?

Create layers with the different stuff and 2 cameras to switch them.

Or

Create the different “scenes” in different world positions, let’s say your camera has a far plane of 1000, then put your world map or menu 2000 units away so it will never be drawn by your main camera and the world map/menu camera will never draw your game scene.

.ORG