Exemple #1
0
        private static void CacheAsestsInSameDirectoryAsAsset(UnityEngine.Object asset, ref AssetCache assetCache)
        {
            var path           = AssetDatabase.GetAssetPath(asset);
            var assetDirectory = AssetDatabaseUtility.GetDirectoryFromAssetPath(path);

            assetCache.LoadAssetsInAssetDirectory(assetDirectory);
        }
Exemple #2
0
        private static void CacheAssetsInSameDirectories(BulkRenamePreview preview, ref AssetCache assetCache)
        {
            for (int i = 0; i < preview.NumObjects; ++i)
            {
                var previewForObject = preview.GetPreviewAtIndex(i);
                var thisObject       = previewForObject.ObjectToRename;
                if (!thisObject.IsAsset())
                {
                    // Scene objects can be named the same thing, so skip these
                    continue;
                }

                var assetDirectory = AssetDatabaseUtility.GetAssetPathDirectory(thisObject);
                assetCache.LoadAssetsInAssetDirectory(assetDirectory);
            }
        }