- Home /
Is it possible to have multiple scenes saved in memory?
I'm making a turn based game where players shoot cannonballs at each others castle. When the castles are hit, the bricks fly and fall using the built in physics engine. I want to make it so that player 1 shoots, then it switches sides so that player 2 shoots, then back again.
I currently have 2 scenes, one for each player, and what I wanted to do was be able to switch between them and keep the positions of all the bricks in between scene changes. Is there any way to do this easily? Or would it be better to just stick both castles on the same scene and switch to a new camera (which I was hoping to not have to do simply because of resource issues. Too many bricks in the scene cause lag, so with both castles in the same scene, it makes the game run too slowly).
I'm currently using Application.LoadLevel to switch between the two, but obviously this causes the scenes (and the castles) to reset each time it is the next player's turn. Is it possible to just switch back and forth between the two while saving the states of everything in the scenes during the switch?
Why don't use only one scene ? It's a network game ? You can although use this : http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html
But just say this like that is really complicated for us to imagine what you really wanna do with your scene / game. If it's networked you just need one scene and maybe for all others mode too.
Why would you do 2 scenes ?
You can look this link too : http://whydoidoit.com/unity-serializer-v0-2/
Answer by whydoidoit · Sep 18, 2012 at 11:59 AM
One idea - if you make both castles live beneath a different game object you could SetActiveRecursively to turn off one of the castles while the other is being simulated. If your cameras are also beneath the same object then they should also switch on and off correctly.
Your answer
Follow this Question
Related Questions
Instantiate 3 guiTextures at the same 1 Answer
How to instantiate everything inside an Array? 1 Answer
Rotating Multiple Objects at once (OnCollision) 1 Answer
Multiple independent scenes 0 Answers
Multiple Animations at once? 1 Answer