Reading an XML file from unity standalone application and web player.
If you try reading a XML file (or any file) inside a folder within the 'Assets' folder using the System.Xml namespace, you may notice that it works withing the Unity standalone application, but not when compiled and run in the web player.
To make the file readable in both the Unity stand alone application and the web player do the following
1) Create a Resources folder within the Assets folder.
2) Place the file (say Config.xml) within the Resources folder.
3) And use Resources.Load("Config") to load the file.
This would guarantee the file being read in the web player too.
To make the file readable in both the Unity stand alone application and the web player do the following
1) Create a Resources folder within the Assets folder.
2) Place the file (say Config.xml) within the Resources folder.
3) And use Resources.Load("Config") to load the file.
This would guarantee the file being read in the web player too.
Comments