Subclass Selector Attribute for Unity Inspector
Unity editor extension enabling intuitive polymorphic serialization and concrete subclass selection directly within the inspector.
- Result
- Polymorphic serialization in Unity Editor
- Area
- Unity / Packages
Highlights
- Dynamic reflection scanning with cached type resolution for zero inspector lag
- Searchable dropdown UI supporting deep polymorphic inheritance hierarchies
- Full Unity Undo/Redo and Prefab serialization compatibility
Overview
A developer productivity package extending Unity's [SerializeReference] attribute with an elegant, searchable dropdown interface to instantiate, inspect, and swap concrete subclasses directly inside the Unity Inspector.
See it in action
1 screenshot
Select a screenshot to view it full size; the arrow keys move between them.
The challenge
While Unity supports polymorphic serialization with [SerializeReference], the native inspector offers no UI to instantiate or switch concrete implementations without writing cumbersome custom editor scripts for every polymorphic type.
What I built
Built a generic PropertyDrawer and type-scanning utility that dynamically identifies all assignable subclasses in the project using cached reflection.
Created a searchable, categorized dropdown popup allowing developers to instantiate instances with default or cloned state.
Fully integrated with Unity's Undo, Redo, and Prefab override serialization pipelines.
Outcome
Dramatically accelerated game configuration workflows for state machines, ability systems, and AI behavior trees, saving game engineers dozens of hours of custom editor boilerplate.