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 : OdinEditorInherits: 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
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
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
Edit mode shows no data The monitors dictionary is only populated at runtime by ScriptableFactoryManager.Start(). In edit mode, the inspector shows a placeholder message. Do not assume factory data is available outside play mode.
See Also
ScriptableFactoryManager — the runtime class this editor inspects
ScriptableFactoryMonitor — the monitor components displayed in the list
ScriptableFactoryRegistryEditor — the registry editor (edit-time counterpart)
Editor Overview — editor tooling overview
Last updated