Class CustomGhostSerializerHelpers
Contains helper methods to write custom chunk serializers.
See GhostPrefabCustomSerializer for more information about what a custom
chunk serializer function pointer should be used for.
Inheritance
CustomGhostSerializerHelpers
Assembly: Unity.NetCode.dll
Syntax
public static class CustomGhostSerializerHelpers
Methods
CopyBufferToSnapshot<T>(T, ArchetypeChunk, ref Context, DynamicComponentTypeHandle*, in GhostCollectionComponentIndex, IntPtr, ref int, ref int)
Declaration
public static void CopyBufferToSnapshot<T>(this T serializer, ArchetypeChunk chunk, ref GhostPrefabCustomSerializer.Context context, DynamicComponentTypeHandle* typeHandles, in GhostCollectionComponentIndex index, IntPtr snapshotData, ref int snapshotOffset, ref int dynamicSnapshotDataOffset) where T : unmanaged, IGhostSerializer
Parameters
Type Parameters
CopyChildBufferToSnapshot<T>(T, ArchetypeChunk, int, ref Context, DynamicComponentTypeHandle*, in GhostCollectionComponentIndex, IntPtr, ref int, ref int)
Declaration
public static void CopyChildBufferToSnapshot<T>(this T serializer, ArchetypeChunk chunk, int indexInChunk, ref GhostPrefabCustomSerializer.Context context, DynamicComponentTypeHandle* typeHandles, in GhostCollectionComponentIndex index, IntPtr snapshotData, ref int snapshotOffset, ref int dynamicSnapshotOffset) where T : unmanaged, IGhostSerializer
Parameters
Type Parameters
CopyChildComponentToSnapshot<T>(T, ArchetypeChunk, int, ref Context, DynamicComponentTypeHandle*, in GhostCollectionComponentIndex, IntPtr, ref int)
Copy a single component data for a child component to the snapshot buffer.
Declaration
public static void CopyChildComponentToSnapshot<T>(this T serializer, ArchetypeChunk chunk, int indexInChunk, ref GhostPrefabCustomSerializer.Context context, DynamicComponentTypeHandle* typeHandles, in GhostCollectionComponentIndex index, IntPtr snapshotData, ref int snapshotOffset) where T : unmanaged, IGhostSerializer
Parameters
Type Parameters
CopyComponentToSnapshot<T>(T, ArchetypeChunk, ref Context, DynamicComponentTypeHandle*, in GhostCollectionComponentIndex, IntPtr, ref int)
Copy the component data to the snapshot buffer for the whole chunk starting from
index startIndex to
endIndex.
Declaration
public static void CopyComponentToSnapshot<T>(this T serializer, ArchetypeChunk chunk, ref GhostPrefabCustomSerializer.Context context, DynamicComponentTypeHandle* typeHandles, in GhostCollectionComponentIndex index, IntPtr snapshotData, ref int snapshotOffset) where T : unmanaged, IGhostSerializer
Parameters
Type Parameters
CopyEnableBits(ArchetypeChunk, int, int, int, ref DynamicComponentTypeHandle, byte*, ref int)
Declaration
public static void CopyEnableBits(ArchetypeChunk chunk, int startIndex, int endIndex, int snapshotStride, ref DynamicComponentTypeHandle componentTypeHandle, byte* enableMasks, ref int maskOffset)
Parameters