# GetSceneObjectPreview

> Returns a scene object preview to be used in the search view.

## Definition

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

## GetSceneObjectPreview(GameObject, Vector2, FetchPreviewOptions, Texture2D)

Returns a scene object preview to be used in the search view.

```csharp
public static Texture2D GetSceneObjectPreview(GameObject obj, Vector2 size, FetchPreviewOptions options, Texture2D thumbnail)
```

### Parameters

**** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): Scene object instance.**** (\[Vector2]\(/engine/6000.6/script-reference/unityengine/vector2)): Preview size.**** (\[FetchPreviewOptions]\(/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions)): Preview options.**** (\[Texture2D]\(/engine/6000.6/script-reference/unityengine/texture2d)): Any existing thumbnail in case we cannot obtain a scene object preview.

### Returns

| Type                                                                  | Description                           |
| --------------------------------------------------------------------- | ------------------------------------- |
| [Texture2D](/engine/6000.6/script-reference/unityengine/texture2d.md) | Object preview or thumbnail fallback. |

### Remarks

See [SearchProvider.fetchPreview](/engine/6000.6/script-reference/unityeditor/search/searchprovider/fetchpreview.md).

## GetSceneObjectPreview(SearchContext, GameObject, Vector2, FetchPreviewOptions, Texture2D)

Returns a scene object preview to be used in the search view.

```csharp
public static Texture2D GetSceneObjectPreview(SearchContext ctx, GameObject obj, Vector2 size, FetchPreviewOptions options, Texture2D thumbnail)
```

### Parameters

**** (\[SearchContext]\(/engine/6000.6/script-reference/unityeditor/search/searchcontext)): **** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): Scene object instance.**** (\[Vector2]\(/engine/6000.6/script-reference/unityengine/vector2)): Preview size.**** (\[FetchPreviewOptions]\(/engine/6000.6/script-reference/unityeditor/search/fetchpreviewoptions)): Preview options.**** (\[Texture2D]\(/engine/6000.6/script-reference/unityengine/texture2d)): Any existing thumbnail in case we cannot obtain a scene object preview.

### Returns

| Type                                                                  | Description                           |
| --------------------------------------------------------------------- | ------------------------------------- |
| [Texture2D](/engine/6000.6/script-reference/unityengine/texture2d.md) | Object preview or thumbnail fallback. |

### Remarks

See [SearchProvider.fetchPreview](/engine/6000.6/script-reference/unityeditor/search/searchprovider/fetchpreview.md).
