Selvage is a dependency injection framework for Unity. A script declares the objects it needs with [Inject], and Selvage finds and assigns them: components from your scenes, your assets, instances of your own classes, or objects your code creates. Where each object comes from is set once, in the provider list of your project, so your scripts don't look for anything themselves.

To inject your first members in a few steps, refer to the Quick Usage Guide. If you're familiar with dependency injection containers, refer to What sets Selvage apart.

User Manual sections

SectionDescription
Get startedInstall Selvage, and understand members, dependencies and providers.
Provide dependenciesProvide components, instances of your classes, assets and objects your code creates.
Configure membersChange how and when a member is injected, for one member or for many.
Inspect and debugValidate members before you enter Play mode, and inspect what injected members hold.
Advanced topicsSwap dependencies for tests and platforms, manage the provider list, and write your own providers.
ReferenceSettings, windows, components and code analysis messages.

Contact

For questions and bug reports, use the contact form or email justetools@gmail.com, with what you expected and what happened.

Selvage is distributed under the Unity Asset Store EULA.

Additional resources