How to save in XML in the Editor?

Hi,

I’m creating an infinite level, aka Temple Run. I’m using a technic a la “parking lot”, where I am just changing the position of the pattern to display. However, all those patterns (around 50) are having the same objects inside: some asteroids. For each pattern I have around 10 asteroids. So if I’m creating all those patterns with some prefabs, it makes 500 asteroids to load. I think it can be optimized as all those asteroids are just instances…

I would thus like in my patterns to save just the position of the asteroids (in a xml for example), and then in-game use a pool method for the asteroids and display them at the good position when needed.

I don’t know however how I can use Unity as “level editor” just to create my patterns and then save the positions of objects in a xml.

Any idea? Or any other solution to propose?

Many thanks!

Look at these sites to learn how to save data in an XML:

Learning XML:

http://www.w3schools.com/xml/xml_validator.asp

http://msdn.microsoft.com/en-us/library/y3y47afh(v=vs.90).aspx

Unity to XML:

http://unitynoobs.blogspot.com/2011/04/xml-writing-to-existing-xml-file.html