I’d like to be able to pre-load some of my scenes into memory then switch scenes back and forth.
For example, I would have five scenes (1 through 5) and load them all at once into memory. I would show scene 1, but scene 2 through 5 would be hidden.
Then I would like to be able to hide scene 1 and show scene 2. Another words, hide the current scene and show one of the other pre-loaded scenes.
We’re creating a point and click adventure game and each scene would be a location. It would be nice to be able to have 5 scenes in memory at a time so we don’t have a loading screen each time the player moves to a new location.
Is it possible to do this? Create many scenes and load 5 of them at a time into memory and show\hide them as we need?
I did read this. Am I able to hide the scene that is loaded while showing a different scene?
Each scene I have will be at the same location as all the other scenes…ie not like a 3D continuous world.
To simplify:
Scene 1 has a camera pointing at a quad with an image on the quad.
Scene 2 is the same as scene 1 except the image on the quad is different, but camera and quad coords are the same as the ones in scene1.
Scene 1 and scene 2 are both pre-loaded in memory. I show scene 1 and keep scene 2 “off” or hidden.
Now the player clicks on the right side of scene 1 to move to scene 2. So I hide scene1 and show scene 2.
Is this possible with LoadLevelAdditiveAsync or will having scene 1 and scene2’s coords the same cause an issue?
Just “teleport” (instantly move) your camera/player to the new location, it’ll be no different to replacing area’s with area’s, only less hassle for you to setup.
Also place each scenes content within it’s own gameobject, then when you know you wont need that again unless you trigger it to load, just destroy the gameobject which will kill everything in it, removing it from the scene/memory.
Ok, that makes sense.
I’m new to Unity so please bear with me…
So if I create a parent gameobject and everything in the scene is a child of the parent then I can easily unload scenes by destroying the parent object.
Also, I’m guessing I can translate everything in the scene to the side of the current scene.
Scene 1 is being viewed. Scene 2 has already been loaded and I have translated the parent gameobject so scene 2 is offscreen to the right of scene 1.
Now I just move the main camera to point to scene 2.
Is it possible to tanslate just the parent gameobject and have all the child objects in the scene translate or will I need to translate all the objects?
Thank you for your help.
If you translate the parent, all the children will move relative to it yep. Putting them all inside a master gameobject for that scene just makes them much easier to deal with and ultimately destroy when not needed anymore (since there’s no unloadlevel command).