Class FloatRangeDrawer
Custom UnityEditor.PropertyDrawer for FloatRange. Renders the two
bounds inline as Min and Max labelled float fields. When the property
also carries a UnityEngine.RangeAttribute, the drawer renders a
MinMaxSlider(GUIContent, Rect, ref float, ref float, float, float) between the two fields so designers can drag
either end while staying within the outer bounds.
Inherited Members
Namespace: Scylla.Core.Editor.Drawers
Assembly: ScyllaCore.Editor.dll
Syntax
[CustomPropertyDrawer(typeof(FloatRange))]
public sealed class FloatRangeDrawer : PropertyDrawer
Methods
CreatePropertyGUI(SerializedProperty)
UI Toolkit path: builds a row with "Min" and "Max" float fields, and optionally a UnityEngine.UIElements.MinMaxSlider when the field carries a UnityEngine.RangeAttribute.
Declaration
public override VisualElement CreatePropertyGUI(SerializedProperty property)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | property | The serialized property. |
Returns
| Type | Description |
|---|---|
| VisualElement |
Overrides
GetPropertyHeight(SerializedProperty, GUIContent)
Returns the height of a single property line; the drawer never grows beyond one row.
Declaration
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | property | The serialized property. |
| GUIContent | label | The display label. |
Returns
| Type | Description |
|---|---|
| float | A single line height in pixels. |
Overrides
OnGUI(Rect, SerializedProperty, GUIContent)
Renders the property either as a "Min [field] Max [field]" pair or, when a UnityEngine.RangeAttribute is present, as a min/max slider flanked by the two numeric fields.
Declaration
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | position | The full rectangle allocated for this property. |
| SerializedProperty | property | The serialized property. |
| GUIContent | label | The display label. |