Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AssetPreview

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].
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Class
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public sealed class AssetPreview

Remarks

You can use the methods in this class in the following ways:

Static Methods

Method

Description

GetAssetPreviewReturns a rendered preview texture for an asset. This is the large image shown in the Project window grid view.
GetMiniThumbnailObtains a small icon for a specific object instance.
GetMiniTypeThumbnailObtains the generic icon for the given type.
IsLoadingAssetPreviewChecks whether the preview for a specific asset is still loading. Previews load asynchronously, so poll this and repaint when it finishes.
IsLoadingAssetPreviewsChecks whether any requested previews are still loading. Previews load asynchronously, so poll this and repaint when they finish.
SetPreviewTextureCacheSizeSet the asset preview cache to a size that can hold all visible previews on the screen at once.