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

Auto inject GameObject in the scene

In VContainer, objects that are not explicitly registered will not be injected. Therefore, execute Register for the object you want to inject.

If you want to run "Inject Only" into MonoBehaviour, you can do so by inserting GameObject in the autoInjectGameObject field of LifetimeScope.

Edit this page
Previous
Property / Field Injection
Next
Implicit Relationship Types