using UnityEngine; using System.IO; using System.Collections.Generic; using System; using System.Xml.Serialization; using AX.TrackRecord; public class GetRecord { private static GetRecord stance; public static GetRecord GetInstance() { if (stance == null) { stance = new GetRecord(); } return stance; } public Record_One_root LoadRecord_DeserializeXMLToRecord(int Zaiqing,string filename) { string path = Application.dataPath + @"/ExtendFolder/xml/recordList/" + Zaiqing.ToString()+"/"+ filename; if (File.Exists(path)) { //反序列化XML StreamReader reader = new StreamReader(path); Record_One_root record = new Record_One_root(); XmlSerializer xml = new XmlSerializer(typeof(Record_One_root)); record = xml.Deserialize(reader) as Record_One_root; reader.Close(); //Debug.Log("LoadRecord_DeserializeXMLToRecord"); return record; } return null; } }