unity moving to another scene with current scene being paused
unity-game-engine
Solution
There are two ways that I think you can accomplish this. It all depends on your target platform and how important resources are but here we go:
1) If resources aren't an issue
You could put all your normal scene and battle scene objects in one scene.
Create two empty game objects (One for Town Scene objects and the other for Battle Scene Objects). You can then either have two versions of your game character(s) or one. Then write a script that simply switches the camera(s) from the town scene to the battle scene when a battle is triggered and back to the town scene when the battle is over.
If you have one version of each character you could simply add a script that changes the behaviour of your game character controller to/from battle mode and normal/town mode.
If you have two versions of each character then you would simply need to write the appropriate character controller scripts and activate/deactivate the game characters according to which one you are using. This is how games like Final Fantasy 7,8,9 achieved the same effect. There were two versions of the game characters: one for battle mode and the other for normal mode.
2) If resources ARE an issue (and I think a more efficient way)
You could use the Application.LoadLevelAdditive function. This function allows you to load a different scene and rather than destroy everything in the current scene, it takes the new scene and all it's objects and adds them to the current scene. So basically you can use it something like this:
Create a separate battlescene and within your scene, create an empty game object to hold every object in your scene.
In your noraml scene do the same.
When you need to go to battle mode use:
Application.LoadLevelAdditive ('battlescene');
And when/if you want to unload your battlescene after that you can do so by simply writing code to destroy the battlescene game object since it contains everything from your battle scene.
As with the first method you can decide whether you want to have two different versions of your characters or not. One of the pros of having two versions is that if you want to save time by not going into detail with you game models (especially if your game is really big) you can have save processing power by using scaled down models for the town scene and using polished more detailed models for the battle scene, assuming your battle scene is a small stage representing the place where your characters are fighting. Think final fantasy VII. Just something to consider.
I hope that helps. I've written it all in a rush but lemme know if anything needs clearing up.
Problem
I'm making a turn-based battle game in Unity3D and I have 2 scenes (a town scene and a battle scene). Whenever the character meets a monster, the game jumps to the battle scene where the character does battle and go back to the town scene after defeating or losing. The problem is how to return to the town scene with the same state as when the character enters the battle scene (character position, statuses, etc.) if I use ``` Application.LoadLevel('battlescene'); ``` then ``` Application.loadLevel('townScene'); ``` then the townscene will start from the first time. How to make the townscene continue from where we left off?