Class InfoBoxDrawer
Custom PropertyDrawer for the InfoBoxAttribute.
Inherited Members
Namespace: Scylla.Core.Editor.Attributes
Assembly: ScyllaCore.Editor.dll
Syntax
[CustomPropertyDrawer(typeof(InfoBoxAttribute))]
public sealed class InfoBoxDrawer : PropertyDrawer
Remarks
Renders a Unity HelpBox above the decorated property field. The box icon and
tint are determined by the InfoType specified on the attribute:
- None - plain box with no icon.
- Info - blue info icon.
- Warning - yellow warning icon.
- Error - red error icon.
The box height is calculated dynamically from the message text and the current Inspector width so that multi-line messages always display fully without clipping.
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 help box and the property field below it.
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 dynamically calculated help box height (at least |
Overrides
OnGUI(Rect, SerializedProperty, GUIContent)
Draws the info/warning/error help box above the property field.
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 combined GUI output. The help box occupies the
top portion and the property field is drawn below with a |
| SerializedProperty | property | The UnityEditor.SerializedProperty to make the custom GUI for. |
| GUIContent | label | The label of this property. |