You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
3 years ago
|
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;
|
||
|
}
|
||
|
}
|