# HighlightSearchMode

> Used to specify how to find a given element in the editor to highlight.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public enum HighlightSearchMode
```

## Remarks

Let's consider various approaches to highlighting the Scale control in the Transform component.

Using the [HighlightSearchMode.PrefixLabel](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/prefixlabel.md) mode you can specify the label text "Scale" as the identifier to highlight the entire Scale control with both label and all three number fields included. This mode can't be used if you want to only highlight the X component of the Scale control. Since the label text of the X component is simply "X", you would get the X component of the Position control instead if you attempted that. The [HighlightSearchMode.PrefixLabel](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/prefixlabel.md) mode works for any control that uses [EditorGUI.PrefixLabel](/engine/6000.7/script-reference/unityeditor/editorgui/prefixlabel.md) or [EditorGUI.HandlePrefixLabel](/engine/6000.7/script-reference/unityeditor/editorgui/handleprefixlabel.md).

If you use the [HighlightSearchMode.Content](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/content.md) mode to search for the text "Scale", only the label itself will be highlighted. This mode can highlight what corresponds to a single [GUIStyle.Draw](/engine/6000.7/script-reference/unityengine/guistyle/draw.md) call and hence cannot highlight composite controls. It is particularly useful for highlighting buttons.

The [HighlightSearchMode.Identifier](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/identifier.md) mode searches for rects explicitly marked to be highlightable using the [Highlighter.HighlightIdentifier](/engine/6000.7/script-reference/unityeditor/highlighter/highlightidentifier.md) function. This is for example done for all controls that uses the [SerializedProperty](/engine/6000.7/script-reference/unityeditor/serializedproperty.md) system, using the [SerializedProperty.propertyPath](/engine/6000.7/script-reference/unityeditor/serializedproperty/propertypath.md) as the identifier. This means you could use this mode to highlight the X component of the Scale control by searching for "m\_LocalScale.x".

The [HighlightSearchMode.Auto](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/auto.md) mode searches using all the above modes and can be used in most cases. Searching for "Scale" using this mode will highlight the entire Scale control rather than just the label, since the PrefixLabel handling is hit before the [GUIStyle.Draw](/engine/6000.7/script-reference/unityengine/guistyle/draw.md) call of the label.

Additional Resources: [Highlighter](/engine/6000.7/script-reference/unityeditor/highlighter.md).

## Fields

| Value                                                                                         | Description                                                             |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [Auto](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/auto.md)               | Highlights the first element found using any of the search modes.       |
| [Content](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/content.md)         | Highlights an element containing text using the text as identifier.     |
| [Identifier](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/identifier.md)   | Highlights an element with a given identifier text.                     |
| [None](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/none.md)               | Highlights nothing.                                                     |
| [PrefixLabel](/engine/6000.7/script-reference/unityeditor/highlightsearchmode/prefixlabel.md) | Highlights an entire editor control using its label text as identifier. |
