コード例 #1
0
        private void DropPrefabFolder(PrefabFolderDropData prefabFolderDropData)
        {
            DropPrefabFolderToCategory(prefabFolderDropData);

            if (!_prefabFoldersDropSettings.CreatePrefabTagsForEachDroppedFolder)
            {
                PrefabActions.AssociatePrefabsWithTagCollection(prefabFolderDropData.ValidPrefabs, _prefabFoldersDropSettings.TagNamesForDroppedFolders);
            }
            else
            {
                CreateTagsForDroppedFolderIfNecessaryAndAssociate(prefabFolderDropData);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        private void AssociateDroppedPrefabsWithTags()
        {
            PrefabsToCategoryDropSettings prefabsDropSettings = PrefabsToCategoryDropEventHandler.Get().PrefabsDropSettings;

            PrefabActions.AssociatePrefabsWithTagCollection(_validDroppedPrefabs, prefabsDropSettings.TagNamesForDroppedPrefabs);
        }