public static Tile_DataList ReadFromXML(WWW _xml) //string path { XmlSerializer serializerR = new XmlSerializer(typeof(Tile_DataList)); StringReader reader = new StringReader(_xml.text); Tile_DataList readTiles = serializerR.Deserialize(reader) as Tile_DataList; reader.Close(); return(readTiles); }
IEnumerator ProcessWWW(string path) { WWW www = new WWW("file:///" + path); // the "file:///" here and in the path IS necessary! yield return(www); if (www.error == null) { Tiles_DataObject = ReadFromXML(www); } else { Debug.LogError("ERROR: Problem yielding a WWW text from Xml; is there a 'Tiles.xml' file at" + path + "?"); } www.Dispose(); www = null; }