Last active
April 23, 2020 16:51
-
-
Save openroomxyz/42621294a478ef2ffbb10487f5469961 to your computer and use it in GitHub Desktop.
Unity : How to get a list of path -s to all files (only files excluding sub folders ) in some folder?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static List<string> GetListOfFilesInFolder(string path) | |
{ | |
string[] fileEntries = System.IO.Directory.GetFiles(path); | |
List<string> result = new List<string>(); | |
foreach(string f in fileEntries) | |
{ | |
if(System.IO.File.Exists(f)) | |
{ | |
result.Add(f); | |
} | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment