Struct GhostSpawnBuffer
The GhostSpawnBuffer is the data for a GhostSpawnQueue singleton. It contains a list of ghosts which will be spawned by the GhostSpawnSystem at the beginning of next frame. It is populated by the GhostReceiveSystem and there needs to be a classification system updating after the GhostReceiveSystem which sets the SpawnType so the spawn system knows how to spawn the ghost. A classification system should only modify the SpawnType and PredictedSpawnEntity fields of this struct. InternalBufferCapacity allocated to almost max out chunk memory.
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: solution.dll
Syntax
[InternalBufferCapacity(240)]
public struct GhostSpawnBuffer : IBufferElementData
Fields
Name | Description |
---|---|
Data |
Offset im bytes used to retrieve from the temporary Snapshot |
Dynamic |
The size of the initial dynamic buffers data associated with the entity. |
Ghost |
The ghost id that will be assigned to the new ghost instance. |
Ghost |
The index of the ghost type in the Ghost |
Predicted |
Entity reference assigned by a classification system, when a predicted spawned entity for a newly received
ghost is found. When assigning this Has |
Server |
The tick this ghost was spawned on the server. For any predicted spawning this is the tick that should match since you are interested in when the server spawned the ghost, not when the server first sent the ghost to the client. Using this also means you are not considering ghosts becoming relevant as spawning. |
Spawn |
The type of ghost to spawn. Based on the spawn type, some components may be enable/disabled or removed from the instantiated ghost. |
Properties
Name | Description |
---|---|
Has |
Should be set to true when a ghost classification system has processed this particular ghost spawn instance. It will then not be processed again in a system running later in the frame (like the default classification system). |