示例#1
0
    public static Area_DataList ReadFromXML(WWW _xml)  //string path
    {
        XmlSerializer serializerR = new XmlSerializer(typeof(Area_DataList));
        StringReader  reader      = new StringReader(_xml.text);
        Area_DataList readAreas   = serializerR.Deserialize(reader) as Area_DataList;

        reader.Close();

        return(readAreas);
    }
示例#2
0
    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)
        {
            Areas_DataObject = ReadFromXML(www);
        }
        else
        {
            Debug.LogError("ERROR: Problem yielding a WWW text from Xml; is there a 'Areas.xml' file at" + path + "?");
        }
        www.Dispose();
        www = null;
    }