Menu
VContainer
Getting Startedv1.7.2GitHub
VContainer
  • Getting Started
  • v1.7.2
  • GitHub
  • ABOUT
    • What is VContainer
    • What is DI ?
  • Getting Started
    • Installation
    • Hello World
  • Resolving
    • Constructor Injection
    • Method Injection
    • Property/Field Injection
    • MonoBehaviour
  • Registering
    • Register Plain C# Type
    • Register Factory
    • Register MonoBehaviour
    • Register ScriptableObject
    • Register Callbacks
  • Integrations
    • Plain C# Entry point
    • UniTask
    • UniRx
    • ECS (beta)
  • Scoping
    • Lifetime Overview
    • Generate child scope via scene or prefab
    • Generate child scope with code first
    • Project root LifetimeScope
  • Container API
    • Use Container Directory
    • Implicit Relationship Types
  • 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 -> VContainer -> 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
Use Container Directory