- Home /
Deserialize .XML file from AssetBundle?
OK, I once upon a time used to keep my .XML files in the StreamingAssets folder and use WWW technique for loading them at runtime. However all of that no longer seems to work in Unity (obsolete/deprecated) and now I'm just plain lost.
I have now created and assetbundle that contains my .XML files (level data in .XML format - "World_01_01.xml","World_01_02.xml"..."World_99_99.xml") but I cant figure out where to even begin to extract each .xml file individually at runtime. I've been searching and all I come across is how to do them the way that unity no longer supports :(
Please help!
PS I'm looking to use something like the below to get the data deserialized and into my data structure.
var serializer = new XmlSerializer(typeof(LevelData)); var stream = new FileStream(path, FileMode.Open); var container = serializer.Deserialize(stream) as LevelData; stream.Close();
transform.position = container.titlePos; nummoves = container.numMoves; numpieces = container.numpieces; so on and so on.
Your answer
Follow this Question
Related Questions
Loading game objects dinamycaly 1 Answer
Listing Scenes in assebundle 0 Answers
Load a XML in an AssetBundle 0 Answers
"Simple State Saving" problem. 1 Answer
error when load xml from url 0 Answers