Hi,
I’m nearing completion of my project now, and have begun work on a map creation tool. It’s a fairly simple one at it’s core, it allows you to place pre-made prefabs on a grid, to create a map.
However, I now want to be able to save the maps I create in the map creator. i want to save them as an entire scene, but without the Map creation object that was used to make it.
Is there some unity reference for saving to a scene file, and similarly can I do somehting along the lines of:
Unity.BeforeSaveScene () {
destroy (Map creation unit);
}
Unit.SaveScene;
You can't save scenes at runtime. You need to use an editor script for this. If you save the file as some other format which gets loaded in using file IO methods and then parsed into an actual level, you can do that at runtime. However, this doesn't use the full functionality of the Unity editor, unless you write that yourself.
– syclamothGood question. I also want to create a standalone EXE level editor, to let people edit levels, and save unity scenes (and not custom files that represent the scene).
– DannyBThis is something I wish the Unity team would enact. I create a scene fabulously and easily with the editor, then my character/player runs around and moves things/destroys things. Why wouldn't they give us the ability to SaveAs that scene during runtime? Sure, I can write a very simple script that will foreach every single gameobject and output is essential data, but it just seems to me like this should be inherent using the built in scene loaders.
– Tanoshimi2000You can also use GO1.Setparent(GO2);
– YoungDeveloper