docs.unity.cn
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: solution.dll
    Syntax
    [RequireImplementors]
    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

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

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

    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.

    CopyToSnapshotGenerated(in GhostSerializerState, ref TSnapshot, in TComponent)

    Copy/Convert the component data to the snapshot.

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

    Read the data from the stream into the snapshot data.

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

    Calculate the predicted baseline.

    RestoreFromBackupGenerated(ref TComponent, in TComponent)

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

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

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

    In This Article
    Back to top
    Copyright © 2023 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)