docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IGhostSerializer<TComponent, TSnapshot>

    Interface implemented by all the component/buffer serialiser. For internal use only.

    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    [RequireImplementors]
    [Obsolete("The IGhostSerializer<TComponent, TSnapshot> has been deprecated. Please use the IGhostComponentSerializer instead")]
    public interface IGhostSerializer<TComponent, TSnapshot> where TComponent : unmanaged where TSnapshot : unmanaged
    Type Parameters
    Name Description
    TComponent

    The component type that this interface serialize.

    TSnapshot

    The snapshot struct type that will contains the component data.

    Methods

    CalculateChangeMaskGenerated(in TSnapshot, in TSnapshot, IntPtr, int)

    Compute the change mask for the snapshot in respect to the given baseline

    Declaration
    void CalculateChangeMaskGenerated(in TSnapshot snapshot, in TSnapshot baseline, IntPtr changeMaskData, int startOffset)
    Parameters
    Type Name Description
    TSnapshot snapshot
    TSnapshot baseline
    IntPtr changeMaskData
    int startOffset

    CopyFromSnapshotGenerated(in GhostDeserializerState, ref TComponent, float, float, in TSnapshot, in TSnapshot)

    Copy/Convert the data form the snapshot to the component. Support interpolation and extrapolation.

    Declaration
    void CopyFromSnapshotGenerated(in GhostDeserializerState serializerState, ref TComponent component, float interpolationFactor, float snapshotInterpolationFactorRaw, in TSnapshot snapshotBefore, in TSnapshot snapshotAfter)
    Parameters
    Type Name Description
    GhostDeserializerState serializerState
    TComponent component
    float interpolationFactor
    float snapshotInterpolationFactorRaw
    TSnapshot snapshotBefore
    TSnapshot snapshotAfter

    CopyToSnapshotGenerated(in GhostSerializerState, ref TSnapshot, in TComponent)

    Copy/Convert the component data to the snapshot.

    Declaration
    void CopyToSnapshotGenerated(in GhostSerializerState serializerState, ref TSnapshot snapshot, in TComponent component)
    Parameters
    Type Name Description
    GhostSerializerState serializerState
    TSnapshot snapshot
    TComponent component

    DeserializeGenerated(ref DataStreamReader, in StreamCompressionModel, IntPtr, int, ref TSnapshot, in TSnapshot)

    Read the data from the stream into the snapshot data.

    Declaration
    void DeserializeGenerated(ref DataStreamReader reader, in StreamCompressionModel compressionModel, IntPtr changeMask, int startOffset, ref TSnapshot snapshot, in TSnapshot baseline)
    Parameters
    Type Name Description
    DataStreamReader reader
    StreamCompressionModel compressionModel
    IntPtr changeMask
    int startOffset
    TSnapshot snapshot
    TSnapshot baseline

    PredictDeltaGenerated(ref TSnapshot, in TSnapshot, in TSnapshot, ref GhostDeltaPredictor)

    Calculate the predicted baseline.

    Declaration
    void PredictDeltaGenerated(ref TSnapshot snapshot, in TSnapshot baseline1, in TSnapshot baseline2, ref GhostDeltaPredictor predictor)
    Parameters
    Type Name Description
    TSnapshot snapshot
    TSnapshot baseline1
    TSnapshot baseline2
    GhostDeltaPredictor predictor

    ReportPredictionErrorsGenerated(in TComponent, in TComponent, IntPtr, int)

    Calculate the prediction error for this component.

    Declaration
    void ReportPredictionErrorsGenerated(in TComponent component, in TComponent backup, IntPtr errorsList, int errorsCount)
    Parameters
    Type Name Description
    TComponent component
    TComponent backup
    IntPtr errorsList
    int errorsCount

    RestoreFromBackupGenerated(ref TComponent, in TComponent)

    Restore the component data from the prediction backup buffer. Only serialised fields are restored.

    Declaration
    void RestoreFromBackupGenerated(ref TComponent component, in TComponent backup)
    Parameters
    Type Name Description
    TComponent component
    TComponent backup

    SerializeCombinedGenerated(in TSnapshot, in TSnapshot, IntPtr, int, ref DataStreamWriter, in StreamCompressionModel)

    Serialise the snapshot dato to the based on the calculated changemask.

    Declaration
    void SerializeCombinedGenerated(in TSnapshot snapshot, in TSnapshot baseline, IntPtr changeMaskData, int startOffset, ref DataStreamWriter writer, in StreamCompressionModel compressionModel)
    Parameters
    Type Name Description
    TSnapshot snapshot
    TSnapshot baseline
    IntPtr changeMaskData
    int startOffset
    DataStreamWriter writer
    StreamCompressionModel compressionModel

    SerializeGenerated(in TSnapshot, in TSnapshot, IntPtr, int, ref DataStreamWriter, in StreamCompressionModel)

    Serialise the snapshot dato to the based on the calculated changemask.

    Declaration
    void SerializeGenerated(in TSnapshot snapshot, in TSnapshot baseline, IntPtr changeMaskData, int startOffset, ref DataStreamWriter writer, in StreamCompressionModel compressionModel)
    Parameters
    Type Name Description
    TSnapshot snapshot
    TSnapshot baseline
    IntPtr changeMaskData
    int startOffset
    DataStreamWriter writer
    StreamCompressionModel compressionModel
    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)