Pause level, push on stack, load another level, pop???

Anybody know if I can do this?

So to explain in more detail:

I want to allow the user to bring up a pause menu, which is just an overlay. Then, if they press something such as an options button, I load the options level but I don’t destroy the current level, push the new options level onto “the stack”, they do their thing, once they press “back” it will “pop” the options level off the stack and resume the level where it was paused at (the pause menu).

I like unity…but I’m a c++ programmer used to customizing what I need, and so far I don’t see that it has this capability. Can anyone show me otherwise?

Thank you.

We can do this by using delegats method.
try this link it will help u:

The problem with loading new levels is that the contents will be mixed with what you already have in the scene. You could implement your own stack by tracking everything that is new in the scene after you loaded a new level. So if you do a pop, you just remove those items again. I do not recommend it though, since your original level might spawn new objects in between, and those would be lost after a pop, too.

I suggest you put your options stuff into a prefab that you can add and remove easily from the current scene (or just show and hide). Prefabs are designed to provide a predefined collection of objects and behaviours in a single object which you can instantiate as you like at runtime.

I would create a “room” far away from the main scene (say, x = 10000) and place all items of this pause scene there. When entering the pause scene, I would set a pause flag (to stop some critical jobs, like time counting) and teleport the player to this “room”; when exiting the pause scene, teleport the player back to its original position and clear the pause flag.

This pause scene should be created in the very first level (centered far away from 0,0,0). I would child all its objects to an empty object and call DontDestroyOnLoad for it (all children are affected), so when loading a new level this “pause room” would be kept alive. Some common items, like the RenderSettings, probably would have to be saved, switched to the pause room settings, and restored on return (specially the skybox, fog and ambient light settings).