private void OnGUI() { EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(GUILayout.Width(600)); if (GUILayout.Button("Search", GUILayout.Width(100))) { FindEmptyFoldersInAssets(); } if (GUILayout.Button("Clear", GUILayout.Width(100))) { FoundedFolders.Clear(); IsSearchingComplete = false; } GUILayout.Space(260); if (!IsShowIgnoreList) { if (GUILayout.Button("Show Ignore List", GUILayout.Width(120))) { IsShowIgnoreList = true; IgnoreList.ReadIgnoreList(); OpenWindow(); } } else { if (GUILayout.Button("Hide Ignore List", GUILayout.Width(120))) { IsShowIgnoreList = false; OpenWindow(); } } EditorGUILayout.EndHorizontal(); if (FoundedFolders.Count > 0 && ResultSearchEmptyFolders.IsCompleted) { ScrollPositionMainList = EditorGUILayout.BeginScrollView(ScrollPositionMainList, true, true, GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, GUI.skin.textArea, GUILayout.Width(595), GUILayout.Height(255)); foreach (var folder in FoundedFolders) { folder.Toogle = EditorGUILayout.ToggleLeft(folder.Path, folder.Toogle, GUI.skin.label); } EditorGUILayout.EndScrollView(); } else { if (IsSearchingComplete && ResultSearchEmptyFolders.IsCompleted) { EditorGUILayout.LabelField("Пустых папок не найдено...", GUI.skin.textArea, GUILayout.Width(595), GUILayout.Height(255)); } else { EditorGUILayout.LabelField(" ", GUI.skin.textArea, GUILayout.Width(595), GUILayout.Height(255)); } } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("All", GUILayout.Width(50))) { ToogleAllItems(true); } if (GUILayout.Button("None", GUILayout.Width(50))) { ToogleAllItems(false); } GUILayout.Space(20); if (GUILayout.Button("Delete", GUILayout.Width(100))) { DeleteFoundedFolders(); } GUILayout.Space(20); if (GUILayout.Button("Ignore", GUILayout.Width(100))) { IgnoreToogleFolders(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); if (!IsShowIgnoreList) { EditorGUILayout.EndHorizontal(); return; } EditorGUILayout.BeginVertical(); GUILayout.Space(26); if (IgnoreList.IgnoredFolders.Count < 1) { EditorGUILayout.LabelField(" ", GUI.skin.textArea, GUILayout.Width(595), GUILayout.Height(255)); } else { ScrollPositionIgnoreList = EditorGUILayout.BeginScrollView(ScrollPositionIgnoreList, true, true, GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, GUI.skin.textArea, GUILayout.Width(595), GUILayout.Height(255)); foreach (var folder in IgnoreList.IgnoredFolders) { folder.Toogle = EditorGUILayout.ToggleLeft(folder.Path, folder.Toogle, GUI.skin.label); } EditorGUILayout.EndScrollView(); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("All", GUILayout.Width(50))) { IgnoreList.ToogleAllItems(true); } if (GUILayout.Button("None", GUILayout.Width(50))) { IgnoreList.ToogleAllItems(false); } GUILayout.Space(20); if (GUILayout.Button("Drop", GUILayout.Width(100))) { IgnoreList.RemoveToogleItems(); IgnoreList.WriteIgnoreList(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); }
private static void FilterFoundedFolders() { FoundedFolders = IgnoreList.FilterFoundedFolders(FoundedFolders); IsSearchingComplete = true; }