Factory

Custom Unity Editor tooling for the ScriptableFactory subsystem. Provides a custom Odin inspector that renders factory assets with a styled title box, grouped settings, and system property sections.

Architecture

spinner

Editor Components

Component
Type
Draws
Purpose

Custom Editor

Styled factory inspector with title box, settings group, and system properties

Key Patterns

Two-Section Layout

The inspector divides factory properties into two visual groups:

  1. Factory Settings — All user-defined properties (fields not in the systemProperties list) are drawn inside a styled box with a header label.

  2. System Properties — The internal properties (factorablePool, data, dataVariantSystem) are drawn separately below the settings box.

Static DrawFactoryInspector

ScriptableFactoryEditor.DrawFactoryInspector(PropertyTree) is a static method, allowing other editors to reuse the factory inspector layout without inheriting from ScriptableFactoryEditor. Pass any PropertyTree rooted on a ScriptableFactory to render the standard two-section layout.

Generic Constraint Display

The inspector automatically resolves the factory's generic type arguments via reflection and displays them as a subtitle beneath the asset name (e.g., (EnemyObject, EnemyData)), giving designers immediate visibility into the factory's type constraints.

Dependencies

Dependency
Usage

Odin Inspector

OdinEditor, PropertyTree, InspectorProperty

Paragon.Editor

DrawGUI utility for layout, title box, and styling helpers

UnityEditor

CustomEditor, CanEditMultipleObjects

See Also

Last updated