Hide
interface
Warning
Not work with OnValueChanged yet

Serialize any interface type, either of a Unity Object, or a serializable class/struct.

This is the same as SaintsInterface<>, but now you can simply use the interface type directly.

IMPORTANT: Set your MonoBehaviour/ScriptableObject to partial if the field is declaration inside. If it's inside a normal class/struct, you need to set all parent class/struct to partial

using SaintsField; // Note the `partial`! public partial class SerInterfaceExample : SaintsMonoBehaviour { [SaintsSerialized] private IInterface1 _interface1; } // use in a normal class/struct, set parents partial recursively public partial class SerInterfaceExample : SaintsMonoBehaviour { // Use inside class/struct, you need to set as `partial`, together with all it's container [Serializable] public partial struct SerInterfaceStruct { [SaintsSerialized] private IInterface1 _interface1InStruct; } public SerInterfaceStruct structWithInterface; }