GUIUtility.keyboardControl 键盘控件
static var keyboardControl : int
Description描述
The controlID of the control that has keyboard focus.
具有键盘焦点控件的controlID。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
private string str = "A String!";
void OnGUI() {
str = GUILayout.TextField(str, 10);
Debug.Log("id: " + GUIUtility.keyboardControl);
}
}
// Click on the text field to see the id of the control.
//点击文本字段查看控件的id
private var str : String = "A String!";
function OnGUI() {
str = GUILayout.TextField(str,10);
Debug.Log("id: " + GUIUtility.keyboardControl);
}
最后修改:2011年1月4日 Tuesday 0:39