Version: 2023.1
언어: 한국어

HighlightSearchMode

enumeration

매뉴얼로 전환

설명

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 search 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.

변수

NoneHighlights nothing.
AutoHighlights the first element found using any of the search modes.
IdentifierHighlights an element with a given identifier text.
PrefixLabelHighlights an entire editor control using its label text as identifier.
ContentHighlights an element containing text using the text as identifier.