Class IntRangeDrawer
Custom UnityEditor.PropertyDrawer for IntRange. Renders the two bounds
inline as Min and Max labelled integer fields. When the property also
carries a UnityEngine.RangeAttribute, the drawer renders an integer-snapped
MinMaxSlider(GUIContent, Rect, ref float, ref float, float, float) between the two fields.
Inherited Members
Namespace: Scylla.Core.Editor.Drawers
Assembly: ScyllaCore.Editor.dll
Syntax
[CustomPropertyDrawer(typeof(IntRange))]
public sealed class IntRangeDrawer : PropertyDrawer
Methods
CreatePropertyGUI(SerializedProperty)
UI Toolkit path: builds a row with "Min" and "Max" integer 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)
Override this method to specify how tall the GUI for this field is in pixels.
Declaration
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | property | The SerializedProperty to make the custom GUI for. |
| GUIContent | label | The label of this property. |
Returns
| Type | Description |
|---|---|
| float | The height in pixels. |
Overrides
OnGUI(Rect, SerializedProperty, GUIContent)
Override this method to make your own IMGUI based GUI for the property.
Declaration
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Parameters
| Type | Name | Description |
|---|---|---|
| Rect | position | Rectangle on the screen to use for the property GUI. |
| SerializedProperty | property | The SerializedProperty to make the custom GUI for. |
| GUIContent | label | The label of this property. |