- Home /
Generate map from XML
Hi guys ^^. I have to do a map generator to load variables from a XML. Anyone have any script that reads any variable and then use it, for example, to resize a box?:
A xml, for example:
<stage>
<cube positionX = 0 positionY = 1 size = 2>
</stage>
And then, with a script in Unity, use these variables for create a cube in the position 0,1 and size 2x2? Anyone know how to do it? Thank you very much ;D
Sorry for my english.
Answer by Bunny83 · Dec 11, 2011 at 04:31 AM
http://forum.unity3d.com/threads/25352-Loading-an-XML-file
Btw. XML attribute-values should be surounded with quotation marks (") or you will get in trouble depending on the xml parser you use and what values you store in the attributes.
AFAIK there's no ready-to-use script around so you have to interpret your xml yourself, but it shouldn't be that difficult.
Your answer
![](https://koobas.hobune.stream/wayback/20220613061954im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Xml file not going in APK ... 1 Answer
Map an Image onto an object from a URL 0 Answers
C# Deserializing XML and Assigning Values 1 Answer
IsolatedStorageException: Could not find a part of the path 0 Answers