Version: 2019.4
LanguageEnglish
  • C#

Highlighter.Highlight

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static bool Highlight(string windowTitle, string text);

Declaration

public static bool Highlight(string windowTitle, string text, HighlightSearchMode mode);

Parameters

windowTitle The title of the window the element is inside.
text The text to identify the element with.
mode Optional mode to specify how to search for the element.

Returns

bool true if the requested element was found; otherwise false.

Description

Highlights an element in the editor.

This function will highlight the specified element in the specified window. If the element could not be found, the function returns false. If the element is inside a scrollview and is not currently visible, the scrollview will first automatically scroll to reveal the element and then highlight it.

Once the element is highlighted it will stay highlighted until either the Highlighter.Stop function is called, or the element disappears from view. The element could disappear from view if the user scrolls away from it, the window is closed, the section of the GUI with the element in it is collapsed or otherwise hidden, or when starting or stopping Play Mode.

Most EditorGUI controls can be highlighted using their label as identifier.

Any control that uses the SerializedProperty system can be highlighted using its SerializedProperty.propertyPath.

Any element with text in it can be highlighted using that text as identifier, which is for example useful for buttons.

See the HighlightSearchMode enum for more details on identifying elements.

See Also: Highlighter.Stop, Highlighter.HighlightIdentifier.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961