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


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.