Used to specify how to find a given element in the editor to highlight.
Let's consider various approaches to highlighting the Scale control in the Transform component.
Using the HighlightSearchMode.PrefixLabel 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 mode works for any control that uses EditorGUI.PrefixLabel or EditorGUI.HandlePrefixLabel.
If you use the HighlightSearchMode.Content mode to seach for the text "Scale", only the label itself will be highlighted. This mode can highlight what corresponds to a single GUIStyle.Draw call and hence cannot highlight composite controls. It is particularly useful for highlighting buttons.
The HighlightSearchMode.Identifier mode searches for rects explicitly marked to be highlightable using the Highlighter.HighlightIdentifier function. This is for example done for all controls that uses the SerializedProperty system, using the SerializedProperty.propertyPath 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 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 call of the label.
See Also: Highlighter.
None | Highlights nothing. |
Auto | Highlights the first element found using any of the search modes. |
Identifier | Highlights an element with a given identifier text. |
PrefixLabel | Highlights an entire editor control using its label text as identifier. |
Content | Highlights an element containing text using the text as identifier. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.