# SearchContextAttribute

> This attribute can be attached to a component object field in order to have the ObjectField use the advanced Object Picker.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.Search](/engine/6000.6/script-reference/unityengine/search.md)
* **Assembly:** UnityEngine.CoreModule
* **Inherits from:** [PropertyAttribute](/engine/6000.6/script-reference/unityengine/propertyattribute.md)

```csharp
[AttributeUsage(AttributeTargets.Field)]
public class SearchContextAttribute : PropertyAttribute
```

## Examples

```csharp
[SearchContext("t:mesh is:nested mesh", "asset")]
public UnityEngine.Object assetMesh;
```

## Constructors

| Constructor                                                                                                                                                                                                                                              | Description                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [SearchContextAttribute(System.String)](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string\))                                                                                              | Search context constructor used to add some search context to an object field. |
| [SearchContextAttribute(System.String,System.String)](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string-string\))                                                                         | Search context constructor used to add some search context to an object field. |
| [SearchContextAttribute(System.String,System.String,UnityEngine.Search.SearchViewFlags)](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string-string-searchviewflags\))                      | Search context constructor used to add some search context to an object field. |
| [SearchContextAttribute(System.String,System.Type\[\])](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string-type\))                                                                         | Search context constructor used to add some search context to an object field. |
| [SearchContextAttribute(System.String,UnityEngine.Search.SearchViewFlags)](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string-searchviewflags\))                                           | Search context constructor used to add some search context to an object field. |
| [SearchContextAttribute(System.String,UnityEngine.Search.SearchViewFlags,System.String,System.Type\[\])](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string-searchviewflags-string-type\)) | Search context constructor used to add some search context to an object field. |
| [SearchContextAttribute(System.String,UnityEngine.Search.SearchViewFlags,System.Type\[\])](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/ctor.md#searchcontextattribute\(string-searchviewflags-type\))                      | Search context constructor used to add some search context to an object field. |

## Properties

| Property                                                                                                                    | Description                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [flags](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/flags.md)                                 | Search view flags used to open the Object Picker in various states.                                        |
| [instantiableProviders](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/instantiableproviders.md) | Search provider concrete types that will be instantiated and assigned to the Object Picker search context. |
| [providerIds](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/providerids.md)                     | A list of Search Provider IDs that will be used to create the search context.                              |
| [query](/engine/6000.6/script-reference/unityengine/search/searchcontextattribute/query.md)                                 | Initial search query used to open the Object Picker window.                                                |

## Inheritance

**Inherited Members:**

* [PropertyAttribute.order](/engine/6000.6/script-reference/unityengine/propertyattribute/order.md)
* [PropertyAttribute.applyToCollection](/engine/6000.6/script-reference/unityengine/propertyattribute/applytocollection.md)
* [Attribute.GetCustomAttributes(MemberInfo, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-memberinfo-system-type\))
* [Attribute.GetCustomAttributes(MemberInfo, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-memberinfo-system-type-system-boolean\))
* [Attribute.GetCustomAttributes(MemberInfo)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-memberinfo\))
* [Attribute.GetCustomAttributes(MemberInfo, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-memberinfo-system-boolean\))
* [Attribute.IsDefined(MemberInfo, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-memberinfo-system-type\))
* [Attribute.IsDefined(MemberInfo, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-memberinfo-system-type-system-boolean\))
* [Attribute.GetCustomAttribute(MemberInfo, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-memberinfo-system-type\))
* [Attribute.GetCustomAttribute(MemberInfo, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-memberinfo-system-type-system-boolean\))
* [Attribute.GetCustomAttributes(ParameterInfo)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-parameterinfo\))
* [Attribute.GetCustomAttributes(ParameterInfo, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-parameterinfo-system-type\))
* [Attribute.GetCustomAttributes(ParameterInfo, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-parameterinfo-system-type-system-boolean\))
* [Attribute.GetCustomAttributes(ParameterInfo, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-parameterinfo-system-boolean\))
* [Attribute.IsDefined(ParameterInfo, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-parameterinfo-system-type\))
* [Attribute.IsDefined(ParameterInfo, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-parameterinfo-system-type-system-boolean\))
* [Attribute.GetCustomAttribute(ParameterInfo, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-parameterinfo-system-type\))
* [Attribute.GetCustomAttribute(ParameterInfo, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-parameterinfo-system-type-system-boolean\))
* [Attribute.GetCustomAttributes(Module, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-module-system-type\))
* [Attribute.GetCustomAttributes(Module)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-module\))
* [Attribute.GetCustomAttributes(Module, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-module-system-boolean\))
* [Attribute.GetCustomAttributes(Module, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-module-system-type-system-boolean\))
* [Attribute.IsDefined(Module, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-module-system-type\))
* [Attribute.IsDefined(Module, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-module-system-type-system-boolean\))
* [Attribute.GetCustomAttribute(Module, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-module-system-type\))
* [Attribute.GetCustomAttribute(Module, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-module-system-type-system-boolean\))
* [Attribute.GetCustomAttributes(Assembly, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-assembly-system-type\))
* [Attribute.GetCustomAttributes(Assembly, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-assembly-system-type-system-boolean\))
* [Attribute.GetCustomAttributes(Assembly)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-assembly\))
* [Attribute.GetCustomAttributes(Assembly, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes#system-attribute-getcustomattributes\(system-reflection-assembly-system-boolean\))
* [Attribute.IsDefined(Assembly, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-assembly-system-type\))
* [Attribute.IsDefined(Assembly, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined#system-attribute-isdefined\(system-reflection-assembly-system-type-system-boolean\))
* [Attribute.GetCustomAttribute(Assembly, Type)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-assembly-system-type\))
* [Attribute.GetCustomAttribute(Assembly, Type, bool)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute#system-attribute-getcustomattribute\(system-reflection-assembly-system-type-system-boolean\))
* [Attribute.Equals(Object)](https://learn.microsoft.com/dotnet/api/system.attribute.equals)
* [Attribute.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode)
* [Attribute.Match(Object)](https://learn.microsoft.com/dotnet/api/system.attribute.match)
* [Attribute.IsDefaultAttribute()](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute)
* [Attribute.TypeId()](https://learn.microsoft.com/dotnet/api/system.attribute.typeid)
