- Home /
Question by
metallizard · Mar 05, 2015 at 05:13 PM ·
datapath
where to put XML files in unity project ?
Hi, i have a problem here about xml files.. it seems unity don't compile project as like in unity editor.. i have xml on path
Assets/Scripts/Models/data.xml
so i load my XDocument with that xml path. it works fine on editor but error when i build. please help me :s is there a way to load xml from that path ?
Comment
Answer by ThomasVandenberghe · Mar 06, 2015 at 10:18 AM
You should put your xml in any folder called Resources and access the content by
Resources.Load<TextAsset>("filnamewithoutextension");
Or you could put your xml in Assets/StreamingAssets and access the file via
Application.streamingAssetPath + "/yourxml.xml";
Your answer
