var mpDataPath = Application.dataPath;
var files = Directory.GetFiles(mpDataPath);
but I'd like to NOT have my data files in Assets at runtime (the keep getting imported into Unity authoring) and NOT in my _Data folder at runtime, but maybe up one level.
Are there any symbols I can use to indicate "up one folder level"?
Does Unity allow this if I for example just edit the dataPath string to represent the folder up one level.
My folders might be look this:
application.exe
application_Data
mpData
data files...
(even if you're using javascript, the c# reference will be useful, since all the functions and variable names for the .net classes are exactly the same!)
var oneLevelUp = Application.dataPath + "/../";
var dirInfo = new System.IO.DirectoryInfo(oneLevelUp).GetFiles();
for (fileName in dirInfo) {
print (fileName);
}
Not the exact answer, but related, I recently found the Path class in Unity which has functions for manipulating paths like GetDirectoryName, GetFileName.