# FetchPreviewOptions

> Options for the search provider on how the preview should be fetched.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEditor.Search](/engine/6000.6/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

```csharp
[Flags]
public enum FetchPreviewOptions
```

## Remarks

These options are used by the [SearchProvider.fetchPreview](/engine/6000.6/script-reference/unityeditor/search/searchprovider/fetchpreview.md) functor.

## Examples

```csharp
static Texture2D FetchPreview(SearchItem item, SearchContext context, Vector2 size, FetchPreviewOptions options)
{
    var obj = ObjectFromItem(item);
    if (obj == null)
        return item.thumbnail;

    var assetPath = SearchUtils.GetHierarchyAssetPath(obj, true);
    if (string.IsNullOrEmpty(assetPath))
        return item.thumbnail;

    if (options.HasFlag(FetchPreviewOptions.Large))
    {
        if (AssetPreview.GetAssetPreview(obj) is Texture2D tex)
            return tex;
    }
    return GetAssetPreviewFromPath(assetPath, size, options);
}
```

## Fields

| Value                                                                                            | Description                                                          |
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| [Large](/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions/large.md)         | Indicates that the preview resolution should be higher than 256x256. |
| [None](/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions/none.md)           | No options are defined.                                              |
| [Normal](/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions/normal.md)       | Indicates that the preview size should be around 128x128.            |
| [Preview2D](/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions/preview2d.md) | Indicates that the search provider should generate a 2D preview.     |
| [Preview3D](/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions/preview3d.md) | Indicates that the search provider should generate a 3D preview.     |
