- Home /
Unity iPhone - Directory.GetDirectories() - None Found?
Hi All,
Ok, so my app works fine in the Unity Editor but on the iPhone, Directory.GetDirectories() throws an exception because no directory exists. Within the Unity editor it works swimmingly, and all my folders are pulled out just fine, but not when compiled onto the iPhone.
The path i'm feeding in is the returned path of Application.dataPath plus my "Lessons" directory which i've added inside the Unity editor. However, when I look into the "Unity Player" directory after building, and I explore the .app package, I can see some of my other assets in here, but none of my additional directories and their files - they seem to have disappeared?
I've seen in MonoDevelop that you can tell individual files not to compile - is this something I need to do in order to keep my file structure intact to enable me to lookup directories and their files?
Any advice would be very much appreciated - it's been a day of plentiful hair pulling today ;)
Thanks guys
Mat
Answer by Eric5h5 · Jun 25, 2010 at 12:39 AM
When publishing a build, Unity only includes files that are directly accessed in the editor. The only exceptions are: 1) scripts, since trying to figure out which scripts are referenced is problematic, so all scripts are always included, and 2) everything in the Resources folder, if one exists. So if you want additional files, you'll have to include them manually.
Ah, thanks for your help! For the benefit of anyone else, the manually added folders/files should be added inside of the "Unity Player / Data" directory once you've hit the build button.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Vector3 and power 1 Answer
EXTREMELY basic button question. 2 Answers