Skip to main content

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​

NameTypeDescription
propertySerializedPropertyThe 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​

NameTypeDescription
positionRectRectangle on the screen to use for the property GUI.
propertySerializedPropertyThe SerializedProperty to make the custom GUI for.
labelGUIContentThe label of this property.
  • Methods
    • CreatePropertyGUI(SerializedProperty)
    • OnGUI(Rect, SerializedProperty, GUIContent)