docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GhostCustomSerializerExtensions

    Extension methods for all unmanaged types implementing the IGhostSerializer interface.

    Inheritance
    object
    GhostCustomSerializerExtensions
    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 GhostCustomSerializerExtensions

    Methods

    SerializeBuffer<TSerializer>(TSerializer, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr, ref int, ref int, ref int, ref DataStreamWriter, in StreamCompressionModel, int)

    Serialize a single buffer to the datastream using the default buffer serialisation strategy.

    Declaration
    public static int SerializeBuffer<TSerializer>(this TSerializer serializer, IntPtr snapshot, IntPtr baseline, IntPtr snapshotDynamicData, IntPtr baselineDynamicData, IntPtr changeMaskData, ref int startOffset, ref int snapshotOffset, ref int dynamicSize, ref DataStreamWriter writer, in StreamCompressionModel compressionModel, int sendBuffer = 1) where TSerializer : unmanaged, IGhostSerializer
    Parameters
    Type Name Description
    TSerializer serializer
    IntPtr snapshot
    IntPtr baseline
    IntPtr snapshotDynamicData
    IntPtr baselineDynamicData
    IntPtr changeMaskData
    int startOffset
    int snapshotOffset
    int dynamicSize
    DataStreamWriter writer
    StreamCompressionModel compressionModel
    int sendBuffer
    Returns
    Type Description
    int
    Type Parameters
    Name Description
    TSerializer

    SerializeComponentSingleBaseline<TSerializer>(TSerializer, IntPtr, in IntPtr, IntPtr, ref int, ref int, ref DataStreamWriter, in StreamCompressionModel, int)

    Serialize the given component into the data stream by using a single baseline.

    Declaration
    public static int SerializeComponentSingleBaseline<TSerializer>(this TSerializer serializer, IntPtr snapshot, in IntPtr baseline, IntPtr changeMaskData, ref int startOffset, ref int snapshotOffset, ref DataStreamWriter writer, in StreamCompressionModel compressionModel, int sendComponent = 1) where TSerializer : unmanaged, IGhostSerializer
    Parameters
    Type Name Description
    TSerializer serializer
    IntPtr snapshot
    IntPtr baseline
    IntPtr changeMaskData
    int startOffset
    int snapshotOffset
    DataStreamWriter writer
    StreamCompressionModel compressionModel
    int sendComponent
    Returns
    Type Description
    int
    Type Parameters
    Name Description
    TSerializer

    SerializeComponentThreeBaseline<TSerializer>(TSerializer, IntPtr, IntPtr, IntPtr, IntPtr, IntPtr, ref int, ref int, ref GhostDeltaPredictor, ref DataStreamWriter, in StreamCompressionModel, int)

    Serialize the given component into the data stream by using three baselines. The GhostDeltaPredictor will calculate new predicted baseline that will be used for delta compression.

    Declaration
    public static int SerializeComponentThreeBaseline<TSerializer>(this TSerializer serializer, IntPtr snapshot, IntPtr baseline0, IntPtr baseline1, IntPtr baseline2, IntPtr changeMaskData, ref int startOffset, ref int snapshotOffset, ref GhostDeltaPredictor predictor, ref DataStreamWriter writer, in StreamCompressionModel compressionModel, int sendComponent = 1) where TSerializer : unmanaged, IGhostSerializer
    Parameters
    Type Name Description
    TSerializer serializer
    IntPtr snapshot
    IntPtr baseline0
    IntPtr baseline1
    IntPtr baseline2
    IntPtr changeMaskData
    int startOffset
    int snapshotOffset
    GhostDeltaPredictor predictor
    DataStreamWriter writer
    StreamCompressionModel compressionModel
    int sendComponent
    Returns
    Type Description
    int
    Type Parameters
    Name Description
    TSerializer
    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)