So I have this code:
var serializer = new XmlSerializer(typeof(MyClass));
using(var stream = new FileStream(path, FileMode.Open))
{
return serializer.Deserialize(stream) as MyClass;
}
Basically, it reads an xml file from "path" and returns it as a MyClass.
But what if instead of having the file's path, I have a public TextAsset variable referencing the actual file?
How could I deserialize the "textasset" xml file into MyClass?
↧