Interface Reference


Serialize interface fields in the Unity Inspector. Assign Unity Objects or SerializeReference implementors. Unity does not serialize interface-typed fields. ... **Who this is for**


by santutu


Price History +

Serialize interface fields in the Unity Inspector. Assign Unity Objects or SerializeReference implementors.

Unity does not serialize interface-typed fields. Interfaces are how professional code keeps a stable contract while implementations change. **Interface Reference** makes that work in the Inspector.


**Who this is for**

Anyone who types `ISomething` in code and wants to assign the implementor in the Inspector.


**What you get**

- `InterfaceRef<T>` — Inspector field limited to implementors

- Implementor Picker — search Scene / Assets; Unity Object or Reference

- MonoBehaviour, ScriptableObject, and plain serializable classes

- `.Value` / `.HasValue` / `.TryGetValue`

- Also: `[SerializeReference, SerializeRefInspector]` type picker


**Documentation**

https://santutu.gitbook.io/interface-reference