Small fix

This commit is contained in:
Chandler Cox
2023-10-01 21:11:08 -05:00
parent 6e94b21452
commit bd32619016

View File

@@ -741,9 +741,6 @@ namespace FlaxEditor.Windows
return;
}
var sourceFolder = SelectedNode.Folder;
var sourcePath = sourceFolder.Path;
// Create folder
var moduleFolderPath = Path.Combine(path, moduleName);
Directory.CreateDirectory(moduleFolderPath);
@@ -782,7 +779,7 @@ namespace FlaxEditor.Windows
Editor.Log($"Module created at {modulePath}");
// Get editor target and target files and add module
var files = Directory.GetFiles(sourceFolder.Path);
var files = Directory.GetFiles(path);
var targetModuleText = $"Modules.Add(\"{moduleName}\");\n ";
foreach (var file in files)
{
@@ -791,7 +788,8 @@ namespace FlaxEditor.Windows
var targetText = await File.ReadAllTextAsync(file);
if (!editorModule && targetText.Contains("GameProjectTarget", StringComparison.Ordinal))
// Skip game project if it is suppose to be an editor module
if (editorModule && targetText.Contains("GameProjectTarget", StringComparison.Ordinal))
continue;
// TODO: Handle edge case when there are no modules in a target