From unity-plugin
Configures VContainer IoC containers for Unity, managing service registration, lifetime scopes, dependency resolution, and testable DI patterns.
npx claudepluginhub creator-hian/claude-code-plugins --plugin unity-pluginThis skill uses the workspace's default tool permissions.
VContainer is a high-performance IoC container for Unity, providing dependency injection patterns for testable and maintainable code.
Unity game architecture decision patterns. Service Locator vs Singleton vs DI, Event Bus vs ScriptableObject channels, MonoBehaviour vs plain C#, component composition, manager bootstrap sequences. DECISION format: WHEN/DECISION/SCAFFOLD/GOTCHA. Based on Unity 6.3 LTS.
Provides Godot 4.3+ dependency injection patterns like autoloads, @export injection, service locators, and scene injection for loosely coupled, testable nodes.
Provides .NET dependency injection patterns including service lifetimes, keyed services, decorators, factories, and pitfalls. Useful for service registration, lifetime resolution, and composition design.
Share bugs, ideas, or general feedback.
VContainer is a high-performance IoC container for Unity, providing dependency injection patterns for testable and maintainable code.
Core Topics:
Foundation Required: unity-csharp-fundamentals (TryGetComponent, FindAnyObjectByType, null-safe coding)
Learning Path: DI fundamentals → VContainer basics → Advanced patterns → Testing
using VContainer;
using VContainer.Unity;
// Define service interface
public interface IPlayerService
{
void Initialize();
}
// Implement service
public class PlayerService : IPlayerService
{
public void Initialize() => Debug.Log("Player initialized");
}
// Setup LifetimeScope
public class GameLifetimeScope : LifetimeScope
{
protected override void Configure(IContainerBuilder builder)
{
builder.Register<IPlayerService, PlayerService>(Lifetime.Singleton);
builder.RegisterComponentInHierarchy<PlayerController>();
}
}
// Inject into MonoBehaviour
public class PlayerController : MonoBehaviour
{
[Inject] private readonly IPlayerService mPlayerService;
void Start() => mPlayerService.Initialize();
}
[Inject] attributeCore DI patterns:
Advanced integrations: