ScriptableFactoryManagerEditor

Custom Odin editor for the ScriptableFactoryManager singleton. Replaces the default inspector with a runtime monitoring view that displays all active factories grouped by type, each with expandable lists and ping-to-monitor navigation.

Definition

Namespace: Paragon.Core.ScriptableFactory.Editor Assembly: Paragon.Editor.dll

[CustomEditor(typeof(ScriptableFactoryManager))]
public class ScriptableFactoryManagerEditor : OdinEditor

Inherits: OdinEditor (Sirenix.OdinInspector.Editor) Attribute: [CustomEditor(typeof(ScriptableFactoryManager))]

Remarks

This editor reads the monitors property from ScriptableFactoryManager, which contains a Dictionary<Type, ScriptableFactoryMonitor[]> mapping each factory type to its runtime monitor instances. The view is play-mode only — at edit time, it displays a message prompting the user to enter play mode.

Each factory type group is rendered as a collapsible toolbar row showing the factory type name and instance count. Individual factory entries show a read-only object field with a "Ping Monitor" button that highlights the corresponding ScriptableFactoryMonitor GameObject in the hierarchy.

Quick Lookup

Goal
How

View active factories

Select the ScriptableFactoryManager in play mode

Navigate to a factory monitor

Click "Ping Monitor" on any factory entry

Expand/collapse factory groups

Click the foldout arrow on each type row

Fields

Field
Type
Description

monitorsProperty

InspectorProperty

Odin property for the monitors dictionary

isExpanded

bool

Controls the main "Factories" foldout state

factoryListExpandedMap

Dictionary<Type, bool>

Per-type foldout expansion state

Methods

OnEnable

Initializes the editor by resolving the monitors property from the Odin property tree and creating the expansion state dictionary.

OnInspectorGUI

Main draw method. Renders the "Factories" header box with a foldout. When expanded, iterates over all monitor groups and calls DrawFactoryList() for each.

Behavior:

  • If monitors exist: draws each factory type group in a vertical layout.

  • If no monitors: displays "No factory is being monitored." (play mode) or "Enter play mode to see factories." (edit mode).

DrawFactoryList (private)

Draws a single factory type group as a collapsible toolbar row. Shows the nicified type name and factory count.

DrawFactoryItem (private)

Draws a single factory monitor entry with a read-only object field and "Ping Monitor" button.

Common Pitfalls

circle-exclamation

See Also

Last updated