windowTitle | 元素所在窗口的名称。 |
text | 用于标识元素的文本。 |
mode | 用于指定如何搜索元素的可选模式。 |
bool 如果找到了请求的元素,则为 /true/;否则为 /false/。
在编辑器中突出显示元素。
此函数将在指定窗口中突出显示指定元素。如果未找到此元素,此函数将返回 false。如果此元素位于滚动视图内且当前不显示,则滚动视图将首先自动滚动以显示此元素,然后将其突出显示。
此元素突出显示后将会一直保持突出显示状态,直到调用 Highlighter.Stop 函数,或者此元素从视图中消失。在执行以下操作时,此元素可能会从视图中消失:用户将其滚动出视图,关闭窗口,折叠或隐藏包含此元素的 GUI 部分,启动或停止播放模式。
大部分 EditorGUI 控件都可以通过将其标签用作标识符进行突出显示。
使用 SerializedProperty 系统的任何控件都可以使用其 SerializedProperty.propertyPath 进行突出显示。
任何包含文本的元素都可以通过将此文本用作标识符进行突出显示,这对于按钮非常有用。
有关如何标识元素的更多信息,请参阅 HighlightSearchMode 枚举。
另请参阅:Highlighter.Stop、Highlighter.HighlightIdentifier。
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.