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 < clones; i++)
				Instantiate(Selection.activeGameObject, Vector3.zero, Quaternion.identity);
	}
}
最后修改:2011年7月12日 Tuesday 17:29

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。