UnityEditor.EditorGUILayout.FloatField C# (CSharp) Method

FloatField() public static method

Make a text field for entering float values.

public static FloatField ( GUIContent label, float value ) : float
label UnityEngine.GUIContent Optional label to display in front of the float field.
value float The value to edit.
return float
        public static float FloatField(GUIContent label, float value, params GUILayoutOption[] options)
        {
            Rect position = s_LastRect = GetControlRect(true, 16f, EditorStyles.numberField, options);
            return EditorGUI.FloatField(position, label, value);
        }

Same methods

EditorGUILayout::FloatField ( GUIContent label, float value, GUIStyle style ) : float
EditorGUILayout::FloatField ( float value ) : float
EditorGUILayout::FloatField ( float value, GUIStyle style ) : float
EditorGUILayout::FloatField ( string label, float value ) : float
EditorGUILayout::FloatField ( string label, float value, GUIStyle style ) : float

Usage Example

    bool ShowTreePrototype(TreePrototype treePrototype, int id)
    {
        bool removeThis = false;

        EGL.BeginVertical(GuiUtils.Skin.box);
        {
            GUILayout.Label(id.ToString() + ". " + (treePrototype.prefab != null ? treePrototype.prefab.name : ""));

            EGL.BeginHorizontal();
            {
                treePrototype.prefab = EGL.ObjectField(treePrototype.prefab, typeof(GameObject), false) as GameObject;

                EGL.BeginVertical();
                {
                    treePrototype.bendFactor = EGL.FloatField("Bend Factor", treePrototype.bendFactor);
                }
                EGL.EndVertical();

                if (GUILayout.Button("Remove", GUILayout.Width(64f), GUILayout.Height(64f)))
                {
                    removeThis = true;
                }
            }
            EGL.EndHorizontal();
        }
        EGL.EndVertical();

        return(removeThis);
    }
All Usage Examples Of UnityEditor.EditorGUILayout::FloatField