# ObjectSelectorHandlerWithLabelsAttribute

> Constructor used to declare the ObjectSelectorHandlerWithLabelsAttribute on a field.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine.SearchService](/engine/6000.5/script-reference/unityengine/searchservice.md)
* **Assembly:** UnityEngine.CoreModule

## ObjectSelectorHandlerWithLabelsAttribute(string\[])

Constructor used to declare the [ObjectSelectorHandlerWithLabelsAttribute](/engine/6000.5/script-reference/unityengine/searchservice/objectselectorhandlerwithlabelsattribute.md) on a field.

> **Warning:**
>
> **Removed.** ObjectSelectorHandlerWithLabelsAttribute has been deprecated. Use SearchContextAttribute instead.

```csharp
public ObjectSelectorHandlerWithLabelsAttribute(params string[] labels)
```

### Parameters

**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): An array of strings that represents the different labels to use as constraints.

### Remarks

The "labels" parameter represents the labels to use as constraints. If there is more than one label, an Asset needs to have all the labels for the object selector to display it. If you set the "matchAll" parameter to false to disable this, only one label must be present.

## ObjectSelectorHandlerWithLabelsAttribute(bool, string\[])

Constructor used to declare the [ObjectSelectorHandlerWithLabelsAttribute](/engine/6000.5/script-reference/unityengine/searchservice/objectselectorhandlerwithlabelsattribute.md) on a field.

> **Warning:**
>
> **Removed.** ObjectSelectorHandlerWithLabelsAttribute has been deprecated. Use SearchContextAttribute instead.

```csharp
public ObjectSelectorHandlerWithLabelsAttribute(bool matchAll, params string[] labels)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): This parameter specifies whether all labels must match, or only one of them must be present.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): An array of strings that represents the different labels to use as constraints.

### Remarks

The "labels" parameter represents the labels to use as constraints. If there is more than one label, an Asset needs to have all the labels for the object selector to display it. If you set the "matchAll" parameter to false to disable this, only one label must be present.
