# SelectObject(ISearchContext, Action<Object, bool>, Action<Object>)

> This function is called when a window must be opened to perform a search and select operation.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.SearchService](/engine/6000.5/script-reference/unityeditor/searchservice.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
bool SelectObject(ISearchContext context, Action<Object, bool> onObjectSelectorClosed, Action<Object> onObjectSelectedUpdated)
```

### Parameters

**** (\[ISearchContext]\(/engine/6000.5/script-reference/unityeditor/searchservice/isearchcontext)): The search context.**** (\[Action\<Object, bool>]\(https\://learn.microsoft.com/dotnet/api/system.action)): Callback to call when the selector window is closed. The callback takes two arguments. The first argument is the selected object, or null for none. The second is a boolean that indicates whether the operation was cancelled or not.**** (\[Action\<Object>]\(https\://learn.microsoft.com/dotnet/api/system.action)): Callback to call when the selection in the window changes. This callback takes one argument: the selected object, or null for none.

### Returns

| Type                                                          | Description                                                                                                                                        |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the search engine handles the object select operation, false otherwise. If false is returned, the default object selector is used instead. |

### Remarks

If the function returns false, the default selector is used instead.
