Loading bonus scene and return to previous scene
Hello,
I have the following problem, thats bugging me for hours of trial and error now:
I have a main scene, where the player can collide with an object to trigger a bonus scene. While the bonus scene is running, the main scene must be paused. The bonus scene only lasts for 10 seconds, so after this time, the bonus scene can be destroyed and the player returns to the main scene, where he left it.
I dont know how to do the loading and resuming of the scenes. Saving the state of the main scene in PlayerPrefs is not an option, because I have a lot of GameObjects instantiated. What I tried was to additively load the bonus scene, pause the main scene and after the bonus scene is finished I unload it but I have no way of resuming the game then because it is still in its paused state. As soon as I execute the script of the bonus scene that unloads it, I have no way to execute further code in the main scene to resume the game.
Can you help me?
Thanks in advance!