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

スクリプト言語

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

GUIUtility.GetControlID

public static function GetControlID(focus: FocusType, position: Rect): int;

Description

コントロールのユニークIDを取得します

	// Prints a not used ID that can be assigned to a control

	function OnGUI() {
		// Gets a ID for a control that cannot receive keyboard focus (A button)
		Debug.Log("Available id: " + GUIUtility.GetControlID(FocusType.Passive));
	}
public static function GetControlID(hint: int, focus: FocusType, position: Rect): int;

Description

Get a unique ID for a control, using an integer as a hint to help ensure correct matching of IDs to controls.

public static function GetControlID(contents: GUIContent, focus: FocusType, position: Rect): int;

Description

Get a unique ID for a control, using a the label content as a hint to help ensure correct matching of IDs to controls.