Lite Component
Lightweight behaviour component framework that simplifies polymorphic component serialization in Unity. Adds an intuitive inspector dropdown for selecting and configuring interface-based behaviour implementations without boilerplate code. Requires Unity 2019.3+ and streamlines abstract type serialization through SerializeReference attributes.
com.danand.litecomponent 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/litecomponent.git?path=Assets README Markdown
Copy this to your project's README.md
## Installation
Add **Lite Component** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/litecomponent.git?path=Assets
```
[](https://www.pkglnk.dev/pkg/litecomponent)README
LiteComponent
How to install
Add in Packages/manifest.json to dependencies:
"com.danand.litecomponent": "https://github.com/Danand/LiteComponent.git#0.1.0-package-unity"
How to use
Just add attribute LiteComponent to interface-typed field for drawing implementations dropdown and selected implementation's fields in inspector:
[SerializeReference]
[LiteComponent]
public ICustomBehaviour behaviour;
Notice that Unity 2019.3 is required because of using SerializeReference for abstract types serialization.
Mark every behaviour implementation as Serializable:
[Serializable]
public class ICustomBehaviourImpl : ICustomBehaviour { /* ... */ }
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In