言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

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

Sumbission failed

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

Close

Cancel

public static function Highlight(windowTitle: string, text: string, mode: HighlightSearchMode): bool;
public static bool Highlight(string windowTitle, string text, HighlightSearchMode mode);
public static def Highlight(windowTitle as string, text as string, mode as HighlightSearchMode) as bool

Parameters

windowTitle 要素が入っているウィンドウのタイトル名
text 要素を識別するテキスト
mode 要素を検索する方法を指摘できるオプション

Returns

bool 要求に合った要素が見つかった場合は true 、その他の場合は /false/

Description

エディタ上で要素をハイライトします

この関数により指定されたウィンドウの指定された要素をハイライトします。もし要素が見つからない場合、 false を返します。もし要素がスクロールビューの中にあり、現在は非表示の場合、スクロールビューは自動的にスクロールを行い要素を表示したうえでハイライトします。 要素が一回ハイライトされた後は、 Highlighter.Stop 関数の呼び出しまたはビューから要素が消えるまでハイライトを継続します。ユーザがスクロールする、ウィンドウが閉じられる、要素を含む GUI セクションが折りたたまれる / 隠される、または再生モードの開始 / 停止をすることで要素はビューから消えることがあります。 多くの EditorGUI コントロールは自身のラベルを識別子としてハイライトできます。

// Highlight the Scale property in the Inspector.
// This will work if a GameObject is selected and shown in the Inspector,
// provided that the Transform component is not collapsed.
Highlighter.Highlight ("Inspector", "Scale");
no example available in C#
no example available in Boo

SerializedProperty を使用する任意のコントロールは SerializedProperty.propertyPath を使用してハイライトできます。

// Highlight the X component of the Scale property in the Inspector.
// This will work if a GameObject is selected and shown in the Inspector,
// provided that the Transform component is not collapsed.
Highlighter.Highlight ("Inspector", "m_LocalScale.x");

// If you have your own MonoBehaviour called MyBehaviour with a float called myFloat,
// you can highlight that control in the Inspector like this:
Highlighter.Highlight ("MyBehaviour", "myFloat");
no example available in C#
no example available in Boo

テキストを含む任意の要素はテキストを識別子としてハイライトできるため、例えばボタンで使用すると便利です。

// Highlight the Add Component button in the Inspector.
// This will work if a GameObject is selected and shown in the Inspector.
Highlighter.Highlight ("Inspector", "Add Component");

// Highlight the Create button in the Hierarchy view.
Highlighter.Highlight ("Hierarchy", "Create");
no example available in C#
no example available in Boo

要素の識別の詳細については HighlightSearchMode 列挙体を参照して下さい。 See Also: Highlighter.Stop, Highlighter.HighlightIdentifier.