Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetAssetPreviewFromPath

Returns a preview texture to be used in the search view.
Read time 1 minuteLast updated 10 days ago

Definition

GetAssetPreviewFromPath(string, FetchPreviewOptions)

Returns a preview texture to be used in the search view.
public static Texture2D GetAssetPreviewFromPath(string path, FetchPreviewOptions previewOptions)

Parameters

path

Asset path.

previewOptions

Additional preview options.

Returns

Type

Description

Texture2DPreview texture.

Remarks

GetAssetPreviewFromPath(SearchContext, string, FetchPreviewOptions, Vector2)

Returns a preview texture to be used in the search view.
public static Texture2D GetAssetPreviewFromPath(SearchContext context, string path, FetchPreviewOptions previewOptions, Vector2 previewSize = default)

Parameters


path

Asset path.

previewOptions

Additional preview options.

previewSize

Request size of the preview. This is useful for the DisplayMode.Grid view.

Returns

Type

Description

Texture2DPreview texture.

Remarks

GetAssetPreviewFromPath(string, Vector2, FetchPreviewOptions)

Returns a preview texture to be used in the search view.
public static Texture2D GetAssetPreviewFromPath(string path, Vector2 previewSize, FetchPreviewOptions previewOptions)

Parameters

path

Asset path.

previewSize

Request size of the preview. This is useful for the DisplayMode.Grid view.

previewOptions

Additional preview options.

Returns

Type

Description

Texture2DPreview texture.

Remarks