Save and comunicate across scenes

I have built an in-game level editor, I want to be able to save all of the objects I have created in the editor, to a string or array. Then save that string/array to another object in the Menu scene where I can choose to open it either in the editor or play mode. So basically, how can I save an object in one scene to another scene, and then continually access it across scenes?

I have seen a lot of complicated talk about PlayerPrefs, XML and Serialization, and that just seems to be a lot more complicated then what I want to do.

If you want to save a GameObject, storing its reference in that dictionary won’t do you any good once you change the scene. The object is destroyed and the reference becomes null. The same goes for PlayerPrefs for that matters.

You need a way to create objects from serializable information, which means that can be converted into bytes (that’s how I understand it anyway). GameObject and components cannot. However, you can save enough information to re-create it. Could be a name of a prefab that you can Load later for instance. You’ll probably need the position as well.

Example, the player creates a house and quit. You can save it that way : PlayerPrefs.SetString( + “Object1”, ); Then, when you want to recreate it Resources.Load( PlayerPrefs.GetString( + “Object1” ) );