- Home /
Access Directories in apk
Hi I Am trying to access directories in Unity for Android APK.
Below Code Works for me in Editor Version in windows:
var filepath = string.Format("{0}", Application.streamingAssetsPath, ""); String[] Path = System.IO.Directory.GetDirectories(filepath + "/"); for (int i = 0; i < Path.Length; i++) { Path[i] = Path[i].Replace(path + "/", ""); } return Path;
but when i try to run the same over android it is not able to find the directories due to this line:
String[] Path = System.IO.Directory.GetDirectories(filepath + "/");
Above line in bold works on Windows and not on android APK trying to access directories in apk
Please suggest some code which might work on both APK in android and windows too.
Comment