EditorGUI
- actionKey
- BoundsField
- ColorField
- CurveField
- DrawPreviewTexture
- DrawTextureAlpha
- DropShadowLabel
- EnumPopup
- FloatField
- Foldout
- indentLevel
- InspectorTitlebar
- IntField
- IntPopup
- IntSlider
- LabelField
- LayerField
- MinMaxSlider
- ObjectField
- PasswordField
- Popup
- PrefixLabel
- ProgressBar
- PropertyField
- RectField
- SelectableLabel
- Slider
- TagField
- TextArea
- TextField
- Toggle
- Vector2Field
- Vector3Field
- Vector4Field
EditorGUI.FloatField 浮点数字段
static function FloatField (position : Rect, value : float, style : GUIStyle = EditorStyles.numberField) : float
static function FloatField (position : Rect, label : string, value : float, style : GUIStyle = EditorStyles.numberField) : float
static function FloatField (position : Rect, label : GUIContent, value : float, style : GUIStyle = EditorStyles.numberField) : float
Parameters参数
- positionRectangle on the screen to use for the float field.
屏幕上用于浮点的矩形区域 - labelOptional label to display in front of the float field.
显示在浮点前面的可选择标签 -
valueThe value to edit. // 用来编辑的值
-
styleOptional GUIStyle. // 可选GUIStyle样式
float - The value entered by the user.
返回浮点数- 用户输入的值。
Description描述
Make a text field for entering floats.
制作一个文本字段,可以输入浮点值。
Float Field in an Editor Window.
编辑器中的浮点数字段。
// Editor Script that multiplies the scale of the current selected GameObject
//编辑器脚本 ,乘以当前选择对象的数值范围
class EditorGUIFloatField extends EditorWindow {
var sizeMultiplier : float = 1;
@MenuItem("Examples/Scale selected Object")
static function Init() {
var window = GetWindow(EditorGUIFloatField);
window.position = Rect(0, 0, 210, 30);
window.Show();
}
function OnGUI() {
sizeMultiplier = EditorGUI.FloatField(Rect(3,3,150, 20),
"Increase scale by:",
sizeMultiplier);
if(GUI.Button(Rect(160,3,45,20), "Scale!"))
Selection.activeTransform.localScale =
Selection.activeTransform.localScale * sizeMultiplier;
}
}
最后修改:2011年6月22日 Wednesday 15:18