Vixen
02b45cc4
csharp
public sealed class NetworkPrefabRegistry

What may be spawned, on both ends of the wire.

No guide page documents this yet — the page shows what the code says about itself.

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 NetworkId 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.

Fields and properties (2)

  • public int Count

    How many are registered.

  • public IEnumerable<NetworkPrefab> Prefabs

    Everything registered, in no particular order.

Methods (4)

Used by (4)

  • NetworkSpawnSystemVixen.Net.Engine
  • NetworkSpawnTestsVixen.Net.Engine.Tests
  • NetworkSpawnerVixen.Net.Engine
  • PlayerSpawnerTestsVixen.Net.Engine.Tests