(?) World.DefaultGameObjectInjectionWorld (documentation?)

I’ve seen this on someone’s response on the forum, but there’s no documentation about it’s use in the official docs, only a shallow interface doc, no use case…

I know it is used to get the entity manager… but why it is named like this? what’s the logic behind this property? “game object injection world” what the hell does it means?

I dont like to memorize random names, i prefer to understand the logic behind a design choice… this name is very confusing atm, but there’s must be a logical description for this… (?)

Its the world that conversion process would put its entities in.
“Components” of which are usually attached to the gameObjects / are MonoBehaviours.
[injects from MonoBehaviours]

Hence why the name. Probably a bit confusing, and a better/shorter naming would be “Default”.
But since its all wip, yeah :stuck_out_tongue:

1 Like

yeah, the “injection” part, for a user, makes no sense, but it does makes sense from the engineer point of view… World.Default would be enough, we dont care if it was injected or whatever as simple mortals…

Thanks!

1 Like

When using Netcode for Entities, which world does DefaultGameobjectInjectionWorld point to?

https://github.com/needle-mirror/com.unity.netcode/blob/b55e3ed6c65df7aaa8dfbbc09d00a0bef911e497/Runtime/ClientServerWorld/ClientServerBootstrap.cs#L100
https://github.com/needle-mirror/com.unity.netcode/blob/b55e3ed6c65df7aaa8dfbbc09d00a0bef911e497/Runtime/ClientServerWorld/ClientServerBootstrap.cs#L268
https://github.com/needle-mirror/com.unity.netcode/blob/b55e3ed6c65df7aaa8dfbbc09d00a0bef911e497/Runtime/ClientServerWorld/ClientServerBootstrap.cs#L357
Seems like whichever world gets created first when created with one of the methods in ClientServerBootstrap.