Class CalendarDefinitionEditor
UI Toolkit inspector for CalendarDefinition ScriptableObject assets. Lays out the calendar's Inspector-authored fields under four named sub-sections inside a Calendar foldout, and provides an optional read-only Debug Info foldout so designers can verify derived values without leaving the Inspector.
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
[CustomEditor(typeof(CalendarDefinition))]
[CanEditMultipleObjects]
public sealed class CalendarDefinitionEditor : ScyllaEditorBase
Remarks
The editable Calendar foldout is organized into four sub-sections:
- Time Unit Structure - Hours per day, minutes per hour, seconds per minute, milliseconds per second.
- Calendar Structure - Months, seasons, weekdays lists, First Weekday dropdown, and eras.
- Epoch - Epoch name and year offset.
- Leap Year - The leap-year rule struct.
The First Weekday field is a UnityEngine.UIElements.DropdownField populated
from the live calendar.Weekdays list and rebuilt via
TrackSerializedObjectValue whenever the list changes. When the weekdays list
is empty a disabled UnityEngine.UIElements.IntegerField fallback is shown instead.
The read-only Debug Info foldout (collapsed by default) displays
six computed sub-sections wrapped in SetEnabled(false): Year Length, Day
Length, Season Start Dates, Weekdays, Eras, and Sanity Checks. An editable Sample
Year UnityEngine.UIElements.IntegerField is kept outside the disabled group so the designer
can inspect specific years. Sanity Checks renders an info UnityEngine.UIElements.HelpBox when
all checks pass, or a warning box listing each structural issue otherwise.
Only the stable debug skeleton elements are built once; variable-count sections
(seasons, weekdays, eras) are torn down and rebuilt on each
TrackSerializedObjectValue callback to avoid destroying the focused Sample
Year field during typing.
Methods
BuildInspector(VisualElement)
Subclasses populate root with their inspector content.
The root has the shared Scylla stylesheets pre-loaded.
Declaration
protected override void BuildInspector(VisualElement root)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | root | The inspector's root element. |