View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.1.2
- Last updated
- First released
- Unity version
- 6000.2.14 or later
- Package size
- 339 KB
- Files
- 81
- Favorites
- 5
- Views in the past week
- 8
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- $13.99 on
Keywords
CubeDI
Lightweight dependency injection for Unity with scene scopes, prefab injection before Awake, lifecycle support, and a visual dependency graph with validation
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 8
CubeDI screenshot 1
About this asset
CubeDI helps you organize Unity projects around small, independent services. Register implementations, inject dependencies, and let each context manage its services and lifecycle.
GET STARTED
Register services inside your context’s Configure method:
builder.Register<IInventory, Inventory>(Lifetime.Singleton);
builder.Register<Shop>(Lifetime.Transient);
Receive dependencies through constructors in plain C# classes or use [Inject] on MonoBehaviour fields, properties and methods.
BUILT FOR UNITY
Use SceneContext for scene services, GlobalContext for shared services, and nested contexts for local scopes. Create prefabs through CubeDI to inject their dependencies before Awake and OnEnable.
INSPECT BEFORE PLAY
Find missing bindings, invalid registrations and dependency cycles from the Inspector. Explore relationships in Modern, Classic or List views, focus on individual dependency chains, and copy diagnostic reports.
CONTROL SERVICE LIFETIMES
Use keyed bindings, collections and runtime factories. Manage initialization, update callbacks and disposal with configurable execution priorities.
Full C# source, runnable samples, a PDF/HTML manual, XML API documentation and IL2CPP preservation guidance are included.
SUPPORT
Email: [email protected]
Discord: grandmax1
Telegram: @PBGJ241
From the publisher's Asset Store listing.
Technical details
• Constructor, field, property and method injection, including private injection points and optional dependencies.
• Singleton and Transient lifetimes. Nested child containers provide local scopes.
• Register concrete types, interface implementations, existing instances and factory delegates.
• Fluent registration options: As, AsSelf, AsImplementedInterfaces, Keyed, WithArguments, WithPriority and NonLazy.
• Keyed bindings and multiple implementations of the same contract.
• Collection injection through arrays, IEnumerable<T>, IReadOnlyList<T> and IReadOnlyCollection<T>, plus ResolveAll<T>().
• Injectable Func factories with zero, one or two runtime arguments.
• SceneContext, auto-loaded GlobalContext, nested prefab contexts and additive-scene support.
• IInitializable, ITickable, IFixedTickable, ILateTickable and IDisposable lifecycle support with a shared Unity player-loop runner.
• Configurable execution priorities and deterministic disposal. Containers manage owned singletons; callers own transient disposal.
• resolver.Instantiate injects prefab hierarchies before activation. resolver.AddComponent creates a new GameObject with an injected component. Inactive prefabs remain inactive.
• Inspector and optional pre-Play validation for missing bindings, invalid registrations and dependency cycles. Duplicate registrations produce warnings by default.
• Resolution errors include dependency chains and ownership context. Factory bodies require runtime validation.
• Dependency Graph with Modern, Classic and List views, search, context filtering, focused subgraphs, binding details and copyable reports.
• Improved node ordering and connection routing. All links enabled by default; optional hover animation disabled by default.
• Cached graph analysis and layout, with event-driven refreshes and animation suspended during dragging.
• Cached reflection metadata, prepared dependency plans and pooled argument arrays.
• Supplied benchmarks record zero GC.Alloc events after warmup for cached singleton lookups and reference-member injection. Object creation and collection resolution can allocate.
• Support for disabled Domain Reload and Scene Reload, with all four combinations tested.
• IL2CPP/AOT support without runtime code generation. Preservation guidance and a starter link.xml generator are included; reflection-only application members require preservation.
• Unity 2021.3 LTS / .NET Standard 2.1 API baseline. Release validation covers Unity 6000.0.58f2 and 6000.2.14f1, including Windows x64 Mono and IL2CPP builds. See the included report for the exact test matrix.
• Full C# source, XML API documentation, Quick Start, PDF/HTML manual, migration guidance, runnable samples and automated tests.
• Separate runtime, Editor and test assemblies. Unity Test Framework is optional for using the package.
• Container operations are single-threaded. Automatic open-generic registration and generated injectors are not included.
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 6000.2.14f1 | Compatible | Compatible | Compatible | Compatible |
CubeDI is render-pipeline independent and works with the Built-in Render Pipeline, URP, HDRP and custom Scriptable Render Pipelines. It contains no shaders or rendering assets and requires no pipeline-specific setup
As listed on the Asset Store.