Fast, lightweight dependency injection for Unity. Zenject's power without the bloat - contexts, tags, zero-alloc injection, and a built-in dependency graph window.CubeDI is a lightweight dependency injection container built specifically for Unity.It provides a clean API for organizing services, scene dependencies, prefab creation and application lifecycle while keeping your project easy to understand and debug.WHY CUBEDI?• Constructor, method, field and property injection• SceneContext for scene-level dependencies• Auto-loaded GlobalContext for services shared across scenes• Keyed bindings, multi-binding and nested child containers• Initialize, Tick, FixedTick, LateTick and deterministic Dispose• Prefab injection before Awake through CubeDI instantiation APIs• Built-in validation for missing bindings and dependency cycles• Detailed errors with the complete dependency chain• Visual Dependency Graph with list and graph views• IL2CPP/AOT compatible without runtime code generation• Full C# source code, documentation and runnable samplesVALIDATE BEFORE PLAYCubeDI can inspect your contexts in the Unity Editor and report missing dependencies, circular dependency chains and invalid registrations before entering Play Mode.When resolution fails, CubeDI shows the complete path:PlayerController → WeaponService → IInventoryPREFABS READY BEFORE AWAKEObjects created through CubeDI’s Instantiate and AddComponent APIs receive their dependencies before Awake and OnEnable run. Nested contexts inside prefabs retain their own scope and lifecycle.SEE YOUR CONTAINEROpen Window → CubeDI → Dependency Graph to inspect contexts, bindings and dependency relationships. Missing dependencies and cycles are highlighted directly in the graph.SOURCE INCLUDEDCubeDI ships as fully documented C# source code with runnable samples, automated tests, a migration guide and IL2CPP preservation guidance.SUPPORTEmail: alex.max5568@gmail.comDiscord: grandmax1• Constructor, method, field and property injection• Singleton and Transient lifetimes• Nested child containers for scoped services• Per-scene SceneContext and auto-loaded cross-scene GlobalContext• Keyed bindings for multiple implementations of the same contract• Multi-binding through IEnumerable and ResolveAll()• Parameterized runtime factories using injected Func• IInitializable, ITickable, IFixedTickable, ILateTickable and IDisposable lifecycle support• Deterministic lifecycle ordering with configurable execution priorities• Lightweight shared Unity player-loop runner• Prefab Instantiate and AddComponent APIs with injection before Awake and OnEnable• Nested prefab contexts with independent scope and lifecycle• Full dependency-chain error messages with binding ownership context• Circular dependency detection for constructor and member injection• Validation for missing, duplicate and invalid registrations• Inspector validation and optional validation before entering Play Mode• Dependency Graph Editor window with list and graph views• Search, context filtering and missing-dependency/cycle highlighting• Cached reflection metadata and pooled member-injection arguments• Allocation-free cached singleton resolution after warmup• Allocation-free warmed-up reference field, property and method injection in supplied benchmarks• Safe operation with disabled Domain Reload and Scene Reload• Additive-scene support without stale context registrations• Parent-owned singletons cannot accidentally capture child-scoped services• Child containers and owned services are disposed in deterministic order• Failed singleton construction does not leave a partially initialized cached instance• No Reflection.Emit or runtime code generation• IL2CPP/AOT preservation guidance and link.xml generator included• Separate runtime, editor, tests and samples assembly definitions• Full C# source code, XML documentation, migration guide and runnable samples• Automated EditMode, PlayMode, lifecycle, prefab, scene-reload and IL2CPP tests• Unity 2021.3 LTS or newer




