Class TitleDrawer
Custom PropertyDrawer for the TitleAttribute.
Inherited Members
Namespace: Scylla.Core.Editor.Attributes
Assembly: ScyllaCore.Editor.dll
Syntax
[CustomPropertyDrawer(typeof(TitleAttribute))]
public sealed class TitleDrawer : PropertyDrawer
Remarks
Renders a decorative title header above the decorated property field in the Inspector. The header consists of:
- A bold, 14-point title label (Title).
- An optional italic subtitle label in a muted gray color (Subtitle), rendered when the subtitle is non-empty.
-
An optional 1-pixel horizontal separator line in the Scylla separator color
(SeparatorLine), shown when
ShowLine is
true.
Methods
CreatePropertyGUI(SerializedProperty)
Creates custom GUI with UI Toolkit for the property.
Declaration
public override VisualElement CreatePropertyGUI(SerializedProperty property)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | property | The SerializedProperty to make the custom GUI for. |
Returns
| Type | Description |
|---|---|
| VisualElement | The element containing the custom GUI. |
Overrides
GetPropertyHeight(SerializedProperty, GUIContent)
Returns the total height required to draw the title header block and the property field.
Declaration
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedProperty | property | The UnityEditor.SerializedProperty to calculate the height for. |
| GUIContent | label | The label of this property. |
Returns
| Type | Description |
|---|---|
| float | The sum of |
Overrides
OnGUI(Rect, SerializedProperty, GUIContent)
Draws the title header block (title, optional subtitle, optional separator line) and then the property field directly below it.
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 complete output. The header elements are stacked
at the top of this rect and the property field is drawn after them with a
|
| SerializedProperty | property | The UnityEditor.SerializedProperty to make the custom GUI for. |
| GUIContent | label | The label of this property, passed to the underlying property field. |