Пример #1
0
        /// <summary>
        ///     Deletes the asset with the specified guid from disk.
        /// </summary>
        /// <param name="guid">GUID.</param>
        private static void Delete(string guid)
        {
            string local = AssetDatabase.GUIDToAssetPath(guid);

            // Remove from disk
            if (!AssetDatabase.DeleteAsset(local))
            {
                Debug.LogWarning(string.Format("Couldn't delete {0}", local));
                return;
            }

            // Clear empty directories
            string directory = Path.GetDirectoryName(local);

            MaintenanceUtils.RemoveEmptyDirectories(directory);

            // Update the cache
            List <string> dependencies = s_CachedGuidDependencies[guid];

            s_CachedGuidDependencies.Remove(guid);
            s_GuidOrphans.Remove(guid);

            if (dependencies.Count == 0)
            {
                return;
            }

            CacheParents();
            CacheOrphans();

            EditorUtility.ClearProgressBar();
        }
Пример #2
0
        /// <summary>
        ///     Called when the editor starts, and every time the assembly is recompiled.
        /// </summary>
        static Autorun()
        {
            string path = Path.Combine(Application.dataPath, "Hydra");

            MaintenanceUtils.RemoveEmptyDirectories(path);
        }