public GameDescriptor ReadDescriptor(string path) { var a = Resources.Load <TextAsset>("AwsomeTestGame"); return(GameDescriptor.Deserialize(a.text)); //GameDescriptor ret = new GameDescriptor(); //return GameDescriptor.LoadFromFile(path); }
private static List <GameDescriptor> ReadXmls(List <string> xmlNames, Dictionary <string, MemoryStream> descFiles) { List <GameDescriptor> ret = new List <GameDescriptor>(); foreach (string xmlName in xmlNames) { descFiles[xmlName].Position = 0; StreamReader sr = new StreamReader(descFiles[xmlName]); string xmlTxt = sr.ReadToEnd(); //string xmlTxt = Encoding.UTF8.GetString(descFiles[xmlName].ToArray()); GameDescriptor gd = GameDescriptor.Deserialize(xmlTxt); ret.Add(gd); } return(ret); }