private void SearchForAllFiles(string directoryAbsolutePath, ref List <string> filesPath) { filesPath.AddRange(Directory.GetFiles(directoryAbsolutePath)); string[] folderPaths = Directory.GetDirectories(directoryAbsolutePath); for (int i = 0; i < folderPaths.Length; i++) { string folderPath = folderPaths[i]; if (!PresetManagerUtils.HasAnyPresetForFolder(PresetManagerUtils.AbsoluteToRelativePath(folderPath))) { SearchForAllFiles(folderPath, ref filesPath); } } }
private void DrawOptions() { EditorGUILayout.BeginHorizontal("Box"); bool hasAnyPresetForFolder = PresetManagerUtils.HasAnyPresetForFolder(relativeFolderPath); EditorGUI.BeginDisabledGroup(!hasAnyPresetForFolder); if (GUILayout.Button("Apply on current", EditorStyles.toolbarButton)) { PresetManagerUtils.ApplyPresetsToFolder(relativeFolderPath); } if (GUILayout.Button("Delete Folder Settings", EditorStyles.toolbarButton)) { PresetManagerUtils.ClearAllPresetsForFolder(relativeFolderPath); selectedIndex = 0; } EditorGUI.EndDisabledGroup(); EditorGUILayout.EndHorizontal(); }
private void SearchForAllFiles(string directoryAbsolutePath, ref List <string> filesPath, ref int level) { filesPath.AddRange(Directory.GetFiles(directoryAbsolutePath)); string[] folderPaths = Directory.GetDirectories(directoryAbsolutePath); for (int i = 0; i < folderPaths.Length; i++) { string folderPath = folderPaths[i]; string absoluteToRelativePath = PresetManagerUtils.AbsoluteToRelativePath(folderPath); if (level > PresetManagerSettings.MaximumDirectorySearch) { continue; } if (!PresetManagerUtils.HasAnyPresetForFolder(absoluteToRelativePath)) { level++; SearchForAllFiles(folderPath, ref filesPath, ref level); } } }