UnityProject/Assets/Decentraland/FileUtil.cs
/// <summary>
/// Find an valid path ending with the given string.
/// </summary>
/// <param name="parentFolder">Under which folder to search</param>
/// <param name="partOrPath">The characteristic string to match</param>
/// <returns></returns>
Find an valid path ending with the given string.
Find an valid path ending with the given string .
public static string FindFolder(string parentFolder, string partOrPath)
        {
            var path = Path.Combine(parentFolder, partOrPath);
            if (Directory.Exists(path)) return path;
            foreach (var childDir in Directory.GetDirectories(parentFolder))
            {
                var res = FindFolder(childDir, partOrPath);
                if (res != null) return res;
            }
            return null;
        }
public static string FindFolder ( string parentFolder , string partOrPath ) { var path = Path . Combine ( parentFolder , partOrPath ) ; if ( Directory . Exists ( path ) ) return path ; foreach ( var childDir in Directory . GetDirectories ( parentFolder ) ) { var res = FindFolder ( childDir , partOrPath ) ; if ( res != null ) return res ; } return null ; }
Find an valid path ending with the given string.
Find an valid path ending with the given string .
None
parentFolder
string
Under which folder to search
Under which folder to search
partOrPath
string
The characteristic string to match
The characteristic string to match