docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SnapshotDataLookupHelper

    Helper struct that can be used in your spawn classification systems (and classification jobs) to create SnapshotDataBufferComponentLookup instances. In order to use the helper, the system that create/hold the instance, must be created after the GhostCollectionSystem and after the GhostReceiveSystem, because of the need to retrieve the SpawnedGhostEntityMap and the SnapshotDataLookupCache data.

    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 SnapshotDataLookupHelper

    Constructors

    SnapshotDataLookupHelper(ref SystemState, Entity, Entity)

    Default constructor, collect and initialize all the internal Unity.Entities.BufferFromEntity<T> handles and collect the necessary data structures.

    Declaration
    public SnapshotDataLookupHelper(ref SystemState state, Entity ghostCollectionEntity, Entity spawnMapEntity)
    Parameters
    Type Name Description
    SystemState state

    See: Unity.Entities.SystemState.

    Entity ghostCollectionEntity

    The entity that hold the GhostCollection component

    Entity spawnMapEntity

    The entity that hold the SpawnedGhostEntityMap component

    Methods

    CreateSnapshotBufferLookup()

    Create a new SnapshotDataBufferComponentLookup instance that can be used on the main thread or in job. This method introduce a sync point, because internally retrieve all the necessary Unity.Entities.DynamicBuffer<T>.

    Declaration
    public SnapshotDataBufferComponentLookup CreateSnapshotBufferLookup()
    Returns
    Type Description
    SnapshotDataBufferComponentLookup

    A valid SnapshotDataBufferComponentLookup instance

    Remarks

    The method requires that the Update(ref SystemState) method has been called and that all the internal handles has been updated.

    Update(ref SystemState)

    Call this method in your system OnUpdate to refresh all the internal Unity.Entities.BufferFromEntity<T> handles.

    Declaration
    public void Update(ref SystemState state)
    Parameters
    Type Name Description
    SystemState state

    See: Unity.Entities.SystemState.

    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)