Version: Unity 6.3 LTS (6000.3)
LanguageEnglish
  • C#

AssetPreview.GetAssetPreview

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static Texture2D GetAssetPreview(Object asset);

Parameters

Parameter Description
asset The object to get a preview texture for.

Returns

Texture2D A rendered preview texture for the given asset, or null if the preview is not yet ready.

Description

Returns a rendered preview texture for an asset. This is the large image shown in the Project window grid view.

The preview is rendered on demand and loaded asynchronously, so this might return null until the preview is ready. Poll AssetPreview.IsLoadingAssetPreview and repaint when it finishes. Previews reflect the asset's real appearance (for example a material rendered on a sphere, or a texture with correct color interpretation), so unlike AssetPreview.GetMiniThumbnail a normal map or other non-color texture displays correctly. For an efficient, always-available icon instead of a rendered preview, see AssetDatabase.GetCachedIcon.