public sealed class NetworkPrefabRegistryWhat may be spawned, on both ends of the wire.
Remarks
Both peers build this from the same content, so neither has to send it. A prefab's id is a function of its address ([08](../../../docs/plan/08-asset-pipeline-and-addressables.md)), so a server that registers gameplay/prefabs/crate and a client that registers the same address agree without a handshake. What the handshake is for is noticing that they registered different content under it, which is the catalog's hash rather than this registry's business.
Which nodes get ids is decided here, once. A prefab is a subtree and most of it is scenery: a hundred-entity set piece where one turret rotates should cost one id and one record, not a hundred of each. The rule is that a template node carrying a NetworkObject wants one — so a designer opts an entity into being addressable by putting the component on it — plus the root, which needs one whether or not anybody remembered, because the root is what the spawn itself is addressed to.
⚠ A node already carrying a NetworkId counts too, and that is not the authoring path. A template captured from a live world with Prefab.CaptureFrom has whatever the world had on it, and a world that has been in a session has ids; a template out of a content build has only what the asset could carry, which is NetworkObject and never NetworkId. Reading both means the same subtree registers the same way whichever door it came through — which is the property ANetworkedMarkerSurvivesTheContentBuild exists to hold, and which was false while the marker was the handle.
Fields and properties (2)
public int CountHow many are registered.
public IEnumerable<NetworkPrefab> PrefabsEverything registered, in no particular order.
Methods (4)
public NetworkPrefabId Register(string address, Prefab prefab)Registers a prefab under an address.
public bool TryGet(NetworkPrefabId id, out NetworkPrefab? prefab)Finds a prefab by id.
public bool TryGet(string address, out NetworkPrefab? prefab)Finds a prefab by address.
public NetworkPrefab Require(string address)Finds a prefab by address, or says why not.
Used by (10)
- NetworkDisconnectTestsVixen.Net.Engine.Tests
- NetworkPrefabContentVixen.Net.Engine.Content
- NetworkPrefabContentTestsVixen.Net.Engine.Content.Tests
- NetworkRulesContentTestsVixen.Net.Engine.Content.Tests
- NetworkRulesReferenceTestsVixen.Net.Engine.Tests
- NetworkSceneMapTestsVixen.Net.Engine.Tests
- NetworkSpawnSystemVixen.Net.Engine
- NetworkSpawnTestsVixen.Net.Engine.Tests
- NetworkSpawnerVixen.Net.Engine
- PlayerSpawnerTestsVixen.Net.Engine.Tests