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 AssociateDroppedPrefabsWithTags() { PrefabsToCategoryDropSettings prefabsDropSettings = PrefabsToCategoryDropEventHandler.Get().PrefabsDropSettings; PrefabActions.AssociatePrefabsWithTagCollection(_validDroppedPrefabs, prefabsDropSettings.TagNamesForDroppedPrefabs); }