- Home /
How to hide scenes?
I'm currently trying to make a scene of the inside of a house in my video game, but I don't know how to edit the individual scenes. I don't want to unload the scenes but I want to hide it so I can edit them separately. This is probably a really stupid question, but can someone please help me?
Answer by malcolmjerry · Nov 27, 2017 at 05:37 PM
Scene activeScene = SceneManager.GetActiveScene();
GameObject temp = new GameObject( "stageTempGO" );
GameObject[] allObjects = activeScene.GetRootGameObjects();
foreach (GameObject go in allObjects) {
go.transform.SetParent( temp.transform, false );
}
AsyncOperation async = SceneManager.LoadSceneAsync( "Battle", LoadSceneMode.Additive );
while (!async.isDone) {
yield return new WaitForEndOfFrame();
}
Scene battleScene = SceneManager.GetSceneByName( "Battle" );
SceneManager.MoveGameObjectToScene( xyz...etc, battleScene );
SceneManager.SetActiveScene( battleScene );
temp.SetActive( false );
Your answer
![](https://koobas.hobune.stream/wayback/20220612142653im_/https://answers.unity.com/themes/thub/images/avi.jpg)