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
    • Container API
  • Registering
    • Register Plain C# Type
    • Register using delegate
    • Register Factory
    • Register MonoBehaviour
    • Register ScriptableObject
    • Register Collection
    • Register Callbacks
  • Integrations
    • Plain C# Entry point
    • UniTask
    • UniRx
    • MessagePipe
    • ECS (beta)
  • Scoping
    • Lifetime Overview
    • Generate child scope via scene or prefab
    • Generate child scope with code first
    • Project root LifetimeScope
  • 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
Pre IL Code Generation