Menu
VContainer
Getting Startedv1.4.4GitHub
VContainer
  • Getting Started
  • v1.4.4
  • GitHub
  • ABOUT
    • What is VContainer
    • What is DI ?
  • GETTING STARTED
    • Installation
    • Hello World
  • RESOLVING
    • Constructor Injection
    • Method Injection
    • Property / Field Injection
    • Auto inject GameObject in the scene
    • Implicit Relationship Types
    • Use Container Directory
  • REGISTERING
    • Register Type
    • Register Factory
    • Register MonoBehaviour
    • ScriptableObject Integration
    • Register Callbacks
  • SCOPING
    • Lifetime Overview
    • Loading additional child scope via scene or prefab
    • Generate child scope with code first
    • Project root LifetimeScope
  • UNITY INTEGRATION
    • Dispatching Unity's Lifecycle events
    • Integrating with ECS (beta)
  • OPTIMIZATION
    • Pre IL Code Generation
    • Async Container Build
    • Parallel Container Build
  • Comparing to other libraries
    • Zenject

Project root LifetimeScope

You can specify a root LifetimeScope that will be the parent of all LifetimeScopes.

    1. Create your root LifetimeScope prefab
    1. Create VContainerSettings
    • Choose Assets -> Create -> VContaienr -> VContainer Settings
    1. From your VContainerSettings inspector, set your prefab to the Root Lifetime Scope section.

caution

If you create VContainerSettings from this menu, it will be automatically registered in preload assets.

Edit this page
Previous
Generate child scope with code first
Next
Dispatching Unity's Lifecycle events