private void CreateNewCategoryFromDroppedFolderAndAssignPrefabs(PrefabFolderDropData prefabFolderDropData) { PrefabCategory newPrefabCategory = PrefabCategoryDatabase.Get().CreatePrefabCategory(prefabFolderDropData.FolderNameInPath); newPrefabCategory.SetPathFolderNames(FileSystem.GetFolderNamesInPath(prefabFolderDropData.FolderPath)); newPrefabCategory.AddPrefabCollection(prefabFolderDropData.ValidPrefabs); _lastCreatedCategory = newPrefabCategory; }
private void DropPrefabFolderToCategory(PrefabFolderDropData prefabFolderDropData) { if (_prefabFoldersDropSettings.CreatePrefabCategoriesFromDroppedFolders) { CreateNewCategoryFromDroppedFolderAndAssignPrefabs(prefabFolderDropData); } else { UndoEx.RecordForToolAction(_dropData.DestinationCategory); _dropData.DestinationCategory.AddPrefabCollection(prefabFolderDropData.ValidPrefabs); } }
private void DropPrefabFolder(PrefabFolderDropData prefabFolderDropData) { DropPrefabFolderToCategory(prefabFolderDropData); if (!_prefabFoldersDropSettings.CreatePrefabTagsForEachDroppedFolder) { PrefabActions.AssociatePrefabsWithTagCollection(prefabFolderDropData.ValidPrefabs, _prefabFoldersDropSettings.TagNamesForDroppedFolders); } else { CreateTagsForDroppedFolderIfNecessaryAndAssociate(prefabFolderDropData); } }
private void CreateTagsForDroppedFolderIfNecessaryAndAssociate(PrefabFolderDropData prefabFolderDropData) { string lastFolderNameInFoderPath = prefabFolderDropData.FolderNameInPath; if (PrefabTagDatabase.Get().ContainsPrefabTag(lastFolderNameInFoderPath)) { PrefabActions.AssociatePrefabsWithTag(prefabFolderDropData.ValidPrefabs, lastFolderNameInFoderPath); } else { UndoEx.RecordForToolAction(PrefabTagDatabase.Get()); PrefabTag prefabTag = PrefabTagDatabase.Get().CreatePrefabTag(lastFolderNameInFoderPath); PrefabActions.AssociatePrefabsWithTag(prefabFolderDropData.ValidPrefabs, prefabTag); } }
private void ExtractPrefabFolderDropDataFromDroppedFoldersAndChildFolders() { HashSet <string> folderPaths = GetFolderAndChildFolderPaths(DragAndDrop.paths); foreach (string folderPath in folderPaths) { var prefabFolderDropData = new PrefabFolderDropData(); prefabFolderDropData.FromFolderPath(folderPath, false); if (prefabFolderDropData.NumberOfValidPrefabs != 0) { _prefabFoldersDropDataCollection.Add(prefabFolderDropData); } } }
private void ExtractPrefabFolderDropDataFromFoldersOnly() { string[] folderPaths = DragAndDrop.paths; foreach (string folderPath in folderPaths) { if (FileSystem.FolderExists(folderPath)) { var prefabFolderDropData = new PrefabFolderDropData(); prefabFolderDropData.FromFolderPath(folderPath, true); if (prefabFolderDropData.NumberOfValidPrefabs != 0) { _prefabFoldersDropDataCollection.Add(prefabFolderDropData); } } } }