Utility for fetching asset previews by instance ID of assets, See AssetPreview.GetAssetPreview. Since previews are loaded asynchronously methods are provided for requesting if all previews have been fully loaded, see AssetPreview.IsLoadingAssetPreviews. Loaded previews are stored in a cache, the size of the cache can be controlled by calling [AssetPreview.SetPreviewTextureCacheSize].
You can use the methods in this class in the following ways: - For a rendered preview use AssetPreview.GetAssetPreview. - For a small per-object icon use AssetPreview.GetMiniThumbnail (note: a Texture2D returns the full-size texture, not a thumbnail). - For a generic type icon use AssetPreview.GetMiniTypeThumbnail. - For an optimized, path-based icon useAssetDatabase.GetCachedIcon.
| Method | Description |
|---|---|
| GetAssetPreview | Returns a rendered preview texture for an asset. This is the large image shown in the Project window grid view. |
| GetMiniThumbnail | Obtains a small icon for a specific object instance. |
| GetMiniTypeThumbnail | Obtains the generic icon for the given type. |
| IsLoadingAssetPreview | Checks whether the preview for a specific asset is still loading. Previews load asynchronously, so poll this and repaint when it finishes. |
| IsLoadingAssetPreviews | Checks whether any requested previews are still loading. Previews load asynchronously, so poll this and repaint when they finish. |
| SetPreviewTextureCacheSize | Set the asset preview cache to a size that can hold all visible previews on the screen at once. |