Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. public static class LoadWorldFromXML
  2. {
  3.  
  4. public static List<Location> Load(TextAsset rawFile)
  5. {
  6. List<Location> world = new List<Location>();
  7.  
  8. XmlDocument worldFile = new XmlDocument();
  9. worldFile.LoadXml(rawFile.text);
  10.  
  11. // Starting with the location, start filtering through the whole world.
  12. XmlNodeList locationNodes = worldFile.GetElementsByTagName("LOCATION");
  13.  
  14. foreach (XmlNode loc in locationNodes)
  15. {
  16.  
  17. string locationTag = "";
  18. string locationTitle = "";
  19. string locationBackground = "";
  20. string locationDescription = "";
  21. List<LocationOption> locationOptions = new List<LocationOption>();
  22.  
  23. XmlNodeList locationContent = loc.ChildNodes;
  24. foreach (XmlNode locationItem in locationContent)
  25. {
  26. Debug.Log(locationItem.ToString());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement