ScriptableFactoryRegistryEditor
Custom Odin editor for the ScriptableFactoryRegistry singleton asset. Replaces the default inspector with a structured registry table view that displays all registered factories grouped by type, each with ping-to-asset navigation.
Definition
Namespace: Paragon.Core.ScriptableFactory.Editor Assembly: Paragon.Editor.dll
[CustomEditor(typeof(ScriptableFactoryRegistry))]
public class ScriptableFactoryRegistryEditor : OdinEditorInherits: OdinEditor (Sirenix.OdinInspector.Editor) Attribute: [CustomEditor(typeof(ScriptableFactoryRegistry))]
Remarks
This editor reads the registryTable property from ScriptableFactoryRegistry, which contains a Dictionary<Type, ScriptableFactory[]> mapping each factory interface type to its registered factory assets. Unlike the manager editor, this view is available at both edit time and play mode since the registry is populated via [InitializeOnLoadMethod].
The header includes a custom title box ("Scriptable Factory Registry") with a slight negative spacing adjustment to integrate visually with Unity's default header style.
Each factory type group renders identically to the manager editor pattern — a collapsible toolbar row showing the nicified type name and factory count. Individual entries show a read-only object field with a "Ping Asset" button that selects and pings the factory ScriptableObject in the Project window.
Quick Lookup
View all registered factories
Select the ScriptableFactoryRegistry asset
Navigate to a factory asset
Click "Ping Asset" on any factory entry
Expand/collapse factory groups
Click the foldout arrow on each type row
Fields
registryTableProperty
InspectorProperty
Odin property for the registryTable dictionary
factoryListExpandedMap
Dictionary<Type, bool>
Per-type foldout expansion state
Methods
OnEnable
Initializes the editor by resolving the registryTable property from the Odin property tree and creating the expansion state dictionary.
OnHeaderGUI
Draws a custom header with a "Scriptable Factory Registry" title box, adjusting spacing to integrate with Unity's built-in header.
OnInspectorGUI
Main draw method. Renders the title and delegates to DrawRegistryTable().
DrawRegistryTable (private)
Draws the "Registry Table" box with all factory type groups.
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 entry with a read-only object field and "Ping Asset" button. Clicking "Ping Asset" temporarily selects the factory asset, pings it in the Project window, then restores the registry as the active selection.
Ping Asset preserves selection. The "Ping Asset" button momentarily sets Selection.activeObject to the factory asset to trigger the ping, then immediately resets it back to the registry. This highlights the asset without navigating away from the inspector.
See Also
ScriptableFactoryRegistry — the runtime class this editor inspects
ScriptableFactoryManagerEditor — the manager editor (runtime counterpart)
Editor Overview — editor tooling overview
Last updated