EditorGUILayout.IntField 整数字段

static function IntField (value : int, params options : GUILayoutOption[]) : int
static function IntField (value : int, style : GUIStyle, params options : GUILayoutOption[]) : int
static function IntField (label : string, value : int, params options : GUILayoutOption[]) : int
static function IntField (label : string, value : int, style : GUIStyle, params options : GUILayoutOption[]) : int
static function IntField (label : GUIContent, value : int, params options : GUILayoutOption[]) : int
static function IntField (label : GUIContent, value : int, style : GUIStyle, params options : GUILayoutOption[]) : int

Parameters参数

Returns

int - The value entered by the user.

返回整数,由用户输入的值。

Description描述

Make a text field for entering integers.

制作一个文本字段用于输入整数。

EditorGUILayout.IntField 整数字段

Clone the Selected object a number of times.
复制选择物体的次数。

// Editor Script that clones the selected GameObject a number of times.

//复制选择物体的次数。

class EditorGUILayoutIntField extends EditorWindow {



	var clones : int = 1;



	@MenuItem("Examples/Clone Object")

	static function Init() {

		var window = GetWindow(EditorGUILayoutIntField);

		window.Show();

	}



	function OnGUI() {

		sizeMultiplier = EditorGUILayout.IntField("Number of clones:", clones);

		if(GUILayout.Button("Clone!"))

				for(var i = 0; i Selection.activeGameObject, Vector3.zero, Quaternion.identity);

	}

}
Page last updated: 2011-7-12