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参数
- labelOptional label in front of the toggle. // 开关按钮前面的可选标签。
- valueThe value to edit. // 编辑的值
- styleOptional GUIStyle. // 可选样式
- optionsAn optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style. See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
指定额外布局属性的可选列表。这里传递任意值,将覆盖样式定义的设置。
Returns
int - The value entered by the user.
返回整数,由用户输入的值。
Description描述
Make a text field for entering integers.
制作一个文本字段用于输入整数。
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++)="">Selection.activeGameObject, Vector3.zero, Quaternion.identity);}}