| name | GUI.SetNextControlName を使用して Name を設定します。 |
名前付きのテキストフィールドにキーボードフォーカスを移動し、コンテンツの編集を開始します。
Editor GUI ではテキストフィールドはテキスト編集なしでキーボードフォーカスを持つことができます。たとえば上下の矢印キーを使用してテキストフィールド間や他の制御間のフォーカスを切り替えることがあるかもしれません。テキストフィールド内をクリックし、それ自身のテキストの編集を開始します。テキストの内容を移動するために矢印キーを使用します。 EditorGUI.FocusTextInControl はキーボードフォーカスを制御に与える GUI.FocusControl のようですが、テキスト自体の編集を開始します。
See Also: GUI.SetNextControlName, GUI.GetNameOfFocusedControl.
// When pressed the button, selects the "username" Textfield.
var username : String = "username";
var pwd : String = "a pwd";
function OnInspectorGUI () {
// Set the internal name of the textfield
GUI.SetNextControlName ("MyTextField");
// Make the actual text field.
username = EditorGUI.TextField (Rect (10,10,100,20), username);
pwd = EditorGUI.TextField (Rect (10,40,100,20), pwd);
// If the user presses this button, keyboard focus will move.
if (GUI.Button (Rect (10,70,80,20), "Move Focus"))
EditorGUI.FocusTextInControl ("MyTextField");
}