docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Property DefaultGameObjectInjectionWorld

    DefaultGameObjectInjectionWorld

    The default World. The code that runs outside a system reads this property to reach a world.

    Declaration
    public static World DefaultGameObjectInjectionWorld { get; set; }
    Property Value
    Type Description
    World
    Remarks

    Initialize(string, bool) assigns this property, so it's null until Unity creates the default world, and null again after you dispose that world.

    Code that runs outside a system has no world to work from, so it reads this property instead. This applies both to your own MonoBehaviour scripts and to Editor tools such as the SubScene Inspector and the Entity Inspector. The most common use in your own code is to reach an EntityManager, for example World.DefaultGameObjectInjectionWorld.EntityManager.

    Assigning a different world to this property redirects all of those callers to that world.

    See Also
    ICustomBootstrap
    DefaultWorldInitialization
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)