docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SnapshotDataBufferComponentLookup

    Helper struct that can be used to inspect the presence of components from a SnapshotData buffer and retrieve their data. The lookup can be passed ot jobs The helper allow to only read component data. Buffers are not supported.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode.LowLevel
    Assembly: Unity.NetCode.dll
    Syntax
    public struct SnapshotDataBufferComponentLookup

    Methods

    GetFallbackPredictionMode(in GhostSpawnBuffer)

    Retrieve the prediction mode used as fallback if the spawning ghost has not been classified.

    Declaration
    public GhostSpawnBuffer.Type GetFallbackPredictionMode(in GhostSpawnBuffer ghost)
    Parameters
    Type Name Description
    GhostSpawnBuffer ghost
    Returns
    Type Description
    GhostSpawnBuffer.Type

    The fallback mode to use

    GetGhostOwner(in GhostSpawnBuffer, in DynamicBuffer<SnapshotDataBuffer>)

    Retrieve the network id of the player owning the ghost if the ghost archetype has a GhostOwner.

    Declaration
    public int GetGhostOwner(in GhostSpawnBuffer ghost, in DynamicBuffer<SnapshotDataBuffer> data)
    Parameters
    Type Name Description
    GhostSpawnBuffer ghost
    DynamicBuffer<SnapshotDataBuffer> data
    Returns
    Type Description
    int

    the id of the player owning the ghost, if the GhostOwner is present, 0 otherwise.

    HasBuffer<T>(int)

    Check if the a component of type T is present this spawning ghost.

    Declaration
    public bool HasBuffer<T>(int ghostTypeIndex) where T : unmanaged, IBufferElementData
    Parameters
    Type Name Description
    int ghostTypeIndex

    The index in the GhostCollectionPrefabSerializer collection

    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    HasComponent<T>(int)

    Check if the a component of type T is present this spawning ghost.

    Declaration
    public bool HasComponent<T>(int ghostTypeIndex) where T : unmanaged, IComponentData
    Parameters
    Type Name Description
    int ghostTypeIndex

    The index in the GhostCollectionPrefabSerializer collection

    Returns
    Type Description
    bool
    Type Parameters
    Name Description
    T

    HasGhostOwner(in GhostSpawnBuffer)

    Check if the spawning ghost has a GhostOwner.

    Declaration
    public bool HasGhostOwner(in GhostSpawnBuffer ghost)
    Parameters
    Type Name Description
    GhostSpawnBuffer ghost
    Returns
    Type Description
    bool

    True if the spawning ghost is owner predicted

    IsOwnerPredicted(in GhostSpawnBuffer)

    Check if the spawning ghost mode is owner predicted.

    Declaration
    public bool IsOwnerPredicted(in GhostSpawnBuffer ghost)
    Parameters
    Type Name Description
    GhostSpawnBuffer ghost
    Returns
    Type Description
    bool

    True if the spawning ghost is owner predicted

    TryGetComponentDataFromSnapshotHistory<T>(int, in DynamicBuffer<SnapshotDataBuffer>, out T, int)

    Try to retrieve the data for a component type from the the snapshot history buffer.

    Declaration
    public bool TryGetComponentDataFromSnapshotHistory<T>(int ghostTypeIndex, in DynamicBuffer<SnapshotDataBuffer> snapshotBuffer, out T componentData, int slotIndex = 0) where T : unmanaged, IComponentData
    Parameters
    Type Name Description
    int ghostTypeIndex

    The index in the GhostCollectionPrefabSerializer collection.

    DynamicBuffer<SnapshotDataBuffer> snapshotBuffer

    The entity snapshot history buffer.

    T componentData

    The deserialized component data.

    int slotIndex

    The slot in the history buffer to use.

    Returns
    Type Description
    bool

    True if the component is present and the component data is initialized. False otherwise

    Type Parameters
    Name Description
    T
    Remarks

    Buffers aren't supported.

    Only component present on the root entity can be retrieved. Trying to get data for component in a child entity is not supported.

    TryGetComponentDataFromSpawnBuffer<T>(in GhostSpawnBuffer, in DynamicBuffer<SnapshotDataBuffer>, out T)

    Try to retrieve the data for a component type from the spawning buffer.

    Declaration
    public bool TryGetComponentDataFromSpawnBuffer<T>(in GhostSpawnBuffer ghost, in DynamicBuffer<SnapshotDataBuffer> snapshotData, out T componentData) where T : unmanaged, IComponentData
    Parameters
    Type Name Description
    GhostSpawnBuffer ghost
    DynamicBuffer<SnapshotDataBuffer> snapshotData
    T componentData
    Returns
    Type Description
    bool

    True if the component is present and the component data is initialized. False otherwise

    Type Parameters
    Name Description
    T
    Remarks

    Buffers aren't supported.

    Only component present on the root entity can be retrieved. Trying to get data for component in a child entity is not supported.

    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)