docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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
    object
    CustomGhostSerializerHelpers
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode.LowLevel.Unsafe
    Assembly: Unity.NetCode.dll
    Syntax
    public static class CustomGhostSerializerHelpers

    Methods

    CopyBufferToSnapshot<T>(T, ArchetypeChunk, ref Context, DynamicComponentTypeHandle*, in GhostCollectionComponentIndex, IntPtr, ref int, ref int)

    Copy all buffers in the chunk for a given DynamicComponentTypeHandle to the snapshot buffer, starting from index startIndex to endIndex.

    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 Name Description
    T serializer
    ArchetypeChunk chunk
    GhostPrefabCustomSerializer.Context context
    DynamicComponentTypeHandle* typeHandles
    GhostCollectionComponentIndex index
    IntPtr snapshotData
    int snapshotOffset
    int dynamicSnapshotDataOffset
    Type Parameters
    Name Description
    T

    CopyChildBufferToSnapshot<T>(T, ArchetypeChunk, int, ref Context, DynamicComponentTypeHandle*, in GhostCollectionComponentIndex, IntPtr, ref int, ref int)

    Copy a single buffer on a child entity for a given DynamicComponentTypeHandle to the snapshot buffer.

    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 Name Description
    T serializer
    ArchetypeChunk chunk
    int indexInChunk
    GhostPrefabCustomSerializer.Context context
    DynamicComponentTypeHandle* typeHandles
    GhostCollectionComponentIndex index
    IntPtr snapshotData
    int snapshotOffset
    int dynamicSnapshotOffset
    Type Parameters
    Name Description
    T

    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 Name Description
    T serializer
    ArchetypeChunk chunk
    int indexInChunk
    GhostPrefabCustomSerializer.Context context
    DynamicComponentTypeHandle* typeHandles
    GhostCollectionComponentIndex index
    IntPtr snapshotData
    int snapshotOffset
    Type Parameters
    Name Description
    T

    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 Name Description
    T serializer
    ArchetypeChunk chunk
    GhostPrefabCustomSerializer.Context context
    DynamicComponentTypeHandle* typeHandles
    GhostCollectionComponentIndex index
    IntPtr snapshotData
    int snapshotOffset
    Type Parameters
    Name Description
    T

    CopyEnableBits(ArchetypeChunk, int, int, int, ref DynamicComponentTypeHandle, byte*, ref int)

    Copy all the enable bits state for the given DynamicComponentTypeHandle to the snapshot buffer.

    Declaration
    public static void CopyEnableBits(ArchetypeChunk chunk, int startIndex, int endIndex, int snapshotStride, ref DynamicComponentTypeHandle componentTypeHandle, byte* enableMasks, ref int maskOffset)
    Parameters
    Type Name Description
    ArchetypeChunk chunk
    int startIndex
    int endIndex
    int snapshotStride
    DynamicComponentTypeHandle componentTypeHandle
    byte* enableMasks
    int maskOffset
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)