Hello everybody,
I have a project where I use an XML file to initiate some of my objects. The XML file resides in my Resources folder, but the problem is when I build the game for Web-player, the Web-player cannot find the XML file. I know that the Web-player does not have access to local files on whatever machine it’s being viewed on, but doesn’t the XML file get packaged along with the rest of the stuff like textures, meshes etc. that I can still access it?
Any help is appreciated. Thanks.
The web player can’t load files with normal filesystem calls. You should put the XML in a regular directory in your project and access it via the TextAsset API.
Thanks Matthew, your advice put me on the right track. What I ended up doing is using the byte[ ] array of the TextAsset to create a MemoryStream and use that to initialize my XMLTextReader. It worked!