Skip to content

Recursive flag ignored if there's no excluded paths in prefab generator #1005

@TrevorSundberg

Description

@TrevorSundberg

Unity version:
Unity 6000.2.7f2.

FishNet Version:
4.6.18R Pro

Description:
Recursive flag is always ignored in generator when no excluded files are present. GetProjectFiles always uses SearchOption.AllDirectories.

Replication:
Image

Fixed:

        internal static string[] GetProjectFiles(string startingPath, string fileExtension, List<string> excludedPaths, bool recursive)
        {
            // Opportunity to exit early if there are no excluded paths.
            if (excludedPaths.Count == 0)
            {
                var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;
                string[] strResults = Directory.GetFiles(startingPath, $"*{fileExtension}", searchOption);
                return strResults;
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions