- Home /
Create scene and add to build by script
Hello
I've been trying to make a script where I can create custom levels in a game during runtime and then it needs to save the scene and add it to the build "Scenes in Build" by script.
Is it possible to be done aside than doing it manually ?
By definition, things can't be added to a build during runtime because, if you're in runtime, the game must have already been built...
What are you trying to achieve?
Answer by Graham-Dunnett · Aug 02, 2015 at 08:34 AM
Am 99% sure it's not possible to create scenes at runtime. If I was working on this, I think I'd have two completely blank scenes, and then load scene data as asset bundles. I'd use two scenes so I can switch from one to the next.
Answer by YoungDeveloper · Aug 02, 2015 at 08:39 AM
save scene (editor only)
http://docs.unity3d.com/ScriptReference/EditorApplication.SaveScene.html
to add to build
http://docs.unity3d.com/412/Documentation/ScriptReference/EditorBuildSettings-scenes.html