Saving and Loading an Object and it's Children in Javascript

SO I have an editor that allows you to place objects on another object. It attaches them with fixed joints. I need to be able to save the parent object and all it’s children so that it can either be reloaded in the editor or loaded into the game later. each of the objects have scripts attached to them also. I have not yet delved into saving and loading files in unity and have had some difficulty in finding good tutorials explaining how to do this. If anyone can help it would be greatly appreciated. also I am operating in Javascript.

I’ve done that with X3D as the format.

Basically, you pick a format that works for you. X3D’s spec allows for scripting, but it does not translate well to Unity, so what I did was use X3D’s ‘proto’ nodes to save and load references to Unity prefab files (which can contain scripts, of course). I save the transforms and hierarchy, then reference to the prefab.

I’ve also done this using CSV as the file format.

The easiest way to read from a file is to use TextAssets. They make everything related to reading a text file EXTREMELY easy.

I’m pretty sure you have to use System.IO to write files (or some library).

Like DaveA said, it sounds like you will also probably need to use XML for what you’re after.