Question by
kakaman593 · Apr 17, 2016 at 04:16 PM ·
streamingassetssystem.io
getfiles() works in editor but not in the Game Build
Well, i have created this code to import png files from Streamingassets and its work
DirectoryInfo dir = new DirectoryInfo(Application.streamingAssetsPath + "/Mods");
FileInfo[] info = dir.GetFiles();
Debug.LogError(info.Length);
foreach (FileInfo f in info)
{
fname = Path.GetFileNameWithoutExtension(f.Name);
Debug.Log(fname);
}
but only works in the editor. and when i build and run the game, the code dont work. dir.getfiles()
is returning nothing and in the path are 2 files.
so i want to know if is a problem with my code or is a unity bug or something like that.
Comment
Your answer
