Class SliderIntWithTickMark.TickMarkDrawer
Custom property drawer for TickMarkStruct. This drawer arranges the "value" and "label" properties horizontally in the Unity editor, allowing users to edit both properties of the tick mark in a compact layout.
[CustomPropertyDrawer(typeof(SliderIntWithTickMark.TickMarkStruct))]
public class SliderIntWithTickMark.TickMarkDrawer : PropertyDrawer
Inheritance
Methods
CreatePropertyGUI(SerializedProperty)
Creates the property GUI for the TickMarkStruct. It arranges the "value" and "label" properties horizontally.
public override VisualElement CreatePropertyGUI(SerializedProperty property)
Parameters
| Name | Type | Description |
|---|---|---|
property | SerializedProperty | The serialized property representing the TickMarkStruct. |
Returns
VisualElement — A VisualElement that represents the layout of the TickMarkStruct properties in the Unity editor.
OnGUI(Rect, SerializedProperty, GUIContent)
Creates the custom property GUI for the TickMarkStruct in IMGUI.
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
Parameters
| Name | Type | Description |
|---|---|---|
position | Rect | Rectangle on the screen to use for the property GUI. |
property | SerializedProperty | The SerializedProperty to make the custom GUI for. |
label | GUIContent | The label of this property. |