Struct GhostPrefabCustomSerializer.Context
Contains all the necessary data to perform the chunk serialization.
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct GhostPrefabCustomSerializer.Context
Fields
baselinePerEntityPtr
The baselines to use to serialize the entities. It contains 4 baselines per entity: Index 0-2 the snapshot baseline, Index 3 the dynamic buffer baseline.
Declaration
[NoAlias]
public IntPtr baselinePerEntityPtr
Field Value
Type | Description |
---|---|
Int |
changeMaskOffset
The offsets in bytes from the beginning of the snapshot
Declaration
public int changeMaskOffset
Field Value
Type | Description |
---|---|
int |
childEntityLookup
A lookup used to retrieve the chunk information (chunk and indices) when serializing child components.
Declaration
[ReadOnly]
public EntityStorageInfoLookup childEntityLookup
Field Value
Type | Description |
---|---|
Entity |
dynamicDataCapacity
The capacity (in bytes) of the dynamic snasphot data. This is pre-computed and it is used mostly for boundary checks.
Declaration
public int dynamicDataCapacity
Field Value
Type | Description |
---|---|
int |
dynamicDataOffset
The offset from the beginning of the snapshot
Declaration
public int dynamicDataOffset
Field Value
Type | Description |
---|---|
int |
dynamicDataSizePerEntityPtr
[Output] a buffer that store the total size of the dynamic buffer data for each entity in the chunk.
Declaration
[NoAlias]
public IntPtr dynamicDataSizePerEntityPtr
Field Value
Type | Description |
---|---|
Int |
enablebBitsOffset
The offsets in bytes from the beginning of the snapshot
Declaration
public int enablebBitsOffset
Field Value
Type | Description |
---|---|
int |
endIndex
The index of the last relevant entity in the chunk. This should be used to iterate over the chunk entities. Don't use chunk.Count.
Declaration
public int endIndex
Field Value
Type | Description |
---|---|
int |
entityStartBit
[Output] the buffer where to store the ghost data compressed size and start bit inside the temporary data stream. Stores 2 ints per component, per entity. [1st] Writer bit offset to the start of this components writes. [2nd] Num bits written for this component.
Declaration
[NoAlias]
public IntPtr entityStartBit
Field Value
Type | Description |
---|---|
Int |
ghostChunkComponentTypes
The list of readonly Dynamic
Declaration
[NoAlias]
public IntPtr ghostChunkComponentTypes
Field Value
Type | Description |
---|---|
Int |
ghostChunkComponentTypesPtr
The dynamic type handle of all the registered serializable component types currently in use.
Declaration
[NoAlias]
[ReadOnly]
public IntPtr ghostChunkComponentTypesPtr
Field Value
Type | Description |
---|---|
Int |
ghostChunkComponentTypesPtrLen
The ghost
Declaration
public int ghostChunkComponentTypesPtrLen
Field Value
Type | Description |
---|---|
int |
ghostInstances
the pointer of the Ghost
Declaration
[NoAlias]
public IntPtr ghostInstances
Field Value
Type | Description |
---|---|
Int |
ghostType
The index inside the Ghost
Declaration
public int ghostType
Field Value
Type | Description |
---|---|
int |
hasPreserializedData
instruct the custom serializer to not copy the data to the snapsnot, because has been already pre-serialized
Declaration
public int hasPreserializedData
Field Value
Type | Description |
---|---|
int |
linkedEntityGroupTypeHandle
Type handled used to retrieve the Linked
Declaration
[ReadOnly]
public BufferTypeHandle<LinkedEntityGroup> linkedEntityGroupTypeHandle
Field Value
Type | Description |
---|---|
Buffer |
networkId
The connection Network
Declaration
public int networkId
Field Value
Type | Description |
---|---|
int |
sameBaselinePerEntityPtr
Contains a run-length encoded baseline indices to use for each entities runs. Can be used to determine if an entity is irrelevant.
Declaration
[NoAlias]
public IntPtr sameBaselinePerEntityPtr
Field Value
Type | Description |
---|---|
Int |
serializerState
The Ghost
Declaration
public GhostSerializerState serializerState
Field Value
Type | Description |
---|---|
Ghost |
snapshotDataPtr
The pointer to the buffer that contains the snapshot data. The size of the buffer is fixed
by archetype, being the component set immutable after the prefab has been registered and pre-processed
by the Ghost
Declaration
[NoAlias]
public IntPtr snapshotDataPtr
Field Value
Type | Description |
---|---|
Int |
snapshotDynamicDataPtr
The pointer to the buffer that contains the dynamic buffer snapshot data. This is a variable size buffer.
Declaration
[NoAlias]
public IntPtr snapshotDynamicDataPtr
Field Value
Type | Description |
---|---|
Int |
snapshotOffset
The offset from the start of the snapshot
Declaration
public int snapshotOffset
Field Value
Type | Description |
---|---|
int |
snapshotStride
The size (in bytes) of the snasphot data. Entitiy component data are stored strided by the snapshotSize and the snapshot buffer format is something like: |ent1 | ... |ent n| |c1, c2.. cn| ... |c1, c2.. cn|
Declaration
public int snapshotStride
Field Value
Type | Description |
---|---|
int |
startIndex
The index of the first relevant entity in the chunk.
Declaration
public int startIndex
Field Value
Type | Description |
---|---|
int |
zeroBaseline
a readonly buffer that contains all zero bytes (up to 8kb)
Declaration
[NoAlias]
public IntPtr zeroBaseline
Field Value
Type | Description |
---|---|
Int |