Hello everyone,
I was wondering if anyone had come across this issue, and might be able to help me out. I’m trying to load in an xml file with Resources.Load. I have the following line of code:
textAsset = (TextAsset) Resources.Load(“lvl01”,typeof(TextAsset));
This works in the editor with no issues whatsoever. When I build however, this produces the following error in the development console:
DirectoryNotFoundException: Could not find a part of the path
“C:\Users\John\Desktop\Assets\Resources\lvl01.xml”.
Assuming that I built my game to my Desktop, am I wrong in thinking that part of the filepath is missing, and that It should be looking for “C:\Users\John\Desktop*PROJECTNAME*\Assets\Resources\lvl01.xml”?
I can get the xml file to load if I create an Assets\Resources directory on my Desktop and place lvl01.xml there, but It was my understanding that all my resources were packed in with the project when it is built. I’d rather not have to create external folders, especially on mobile devices.
If anyone could shed some light on this I’d be very grateful.
Thanks.
By the way, I’m using Unity 4.6.1p3.