Skip to content

adammyhre/Unity-Serialized-Interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Seriazable Interfaces

SerializedInterface

Serializable Interfaces in Unity give you the ability to drag, drop, and serialize objects that implement a specific interface in Inspector fields, enabling powerful, type-safe assignments.

Using a custom attribute, you can restrict assignments to components implementing a particular interface. Or use an open generic type that supports serialization of references, enforcing both base types and interface types. This setup leverages custom editor tooling and reflection for seamless Inspector integration, enhanced validation, and intuitive drag-and-drop functionality.

Don't want to serialze yourself but just want the inline hints and drag/drop Inspector framework? Also compatible with the free version of Odin Serializer.

Features

  • Serializable Interfaces: Serialize objects that implement a specific interface in Unity Inspector fields.
  • Require Interface Attribute: Restrict assignments to components implementing a particular interface.
  • Drag & Drop: Drag and drop objects that implement a specific interface in Inspector fields.
  • Hints: Inline hints to show the interface type for any field.

YouTube

Watch the full video on YouTube

You can also check out my YouTube channel for more Unity content.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages