Struct ClientPopulatePrespawnedGhostsSystem
Responsible for assigning a unique ghostId to each pre-spawned ghost, and and adding the ghosts to the spawned ghosts maps. Relies on the previous initializations step to determine the subscene subset to process.
Inherited Members
Namespace: Unity.NetCode
Syntax
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation, WorldSystemFilterFlags.Default)]
[UpdateInGroup(typeof(PrespawnGhostSystemGroup))]
[UpdateAfter(typeof(PrespawnGhostInitializationSystem))]
[BurstCompile]
public struct ClientPopulatePrespawnedGhostsSystem : ISystem
Remarks
Clients expect to receive the following as part ot the protocol:
- The subscene hash and baseline hash for validation.
- The ghost id range for each subscene.
### The Full Prespawn Subscene Sync Protocol
The Client will eventually receive the subscene data and will store it into the PrespawnHashElement
collection.
The Client (in parallel, before or after) will serialize the prespawn baseline when a new scene is loaded.
The Client should validate that:
- The prespawn scenes are present on the server.
- That the count, subscene hash and baseline hash match the one on the server.
The Client will assign the ghost ids to the prespawns. The Client must notify the server what scene sections has been loaded and initialized. ServerPopulatePrespawnedGhostsSystem