What problem does it solve?
This Skill helps Unity developers structure dependency injection without tightly coupling gameplay systems, services, and scene components to concrete implementations or global singletons.
Core Features & Use Cases
- LifetimeScope Architecture: Organize project-wide, scene-specific, and runtime child scopes with clear dependency boundaries.
- Injection Patterns: Apply constructor injection for plain C# classes, method injection for MonoBehaviours, and lifecycle entry points for services that need startup, update, or disposal behavior.
- Registration Guidance: Configure interface bindings, component registration, factories, ScriptableObject instances, and appropriate singleton, scoped, and transient lifetimes.
- Testing and Reliability: Improve testability, avoid circular dependencies, validate registrations, and prevent common Unity DI mistakes.
- Use Case: Use the Skill to design a game scene scope that injects audio, input, scoring, configuration, and player components while keeping shared services in a root scope.
Quick Start
Use the vcontainer skill to design and register a Unity 6 game scene's LifetimeScope with constructor injection for services and method injection for MonoBehaviours.