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!)
Also if you're using Javascript, switch the syntax to JScript in the MSDN docs, and that will almost always be identical to what you use in Unity. They typically don't have JScript example code though.
var oneLevelUp = Application.dataPath + "/../";
var dirInfo = new System.IO.DirectoryInfo(oneLevelUp).GetFiles();
for (fileName in dirInfo) {
print (fileName);
}
Huh, I had tried that initially, but maybe I messed it up in some way...
Not the exact answer, but related, I recently found the Path class in Unity which has functions for manipulating paths like GetDirectoryName, GetFileName.
Also if you're using Javascript, switch the syntax to JScript in the MSDN docs, and that will almost always be identical to what you use in Unity. They typically don't have JScript example code though.
– Eric5h5