docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct TransformLookup

    A [NativeContainer] that provides access to all instances of TransformRef components, indexed by Entity.

    Namespace: Unity.Entities
    Assembly: Unity.Entities.dll
    Syntax
    [NativeContainer]
    public struct TransformLookup
    Remarks

    TransformLookup is a native container that provides array-like access to TransformRef components. For example, while iterating over a set of entities, you can use TransformLookup to get and set the transforms of unrelated entities.

    To get a TransformLookup, call ComponentSystemBase.GetTransformLookup.

    Pass a TransformLookup container to a job by defining a public field of the appropriate type in your IJob implementation. You can safely read from TransformLookup in any job, but by default, you cannot write to components in the container in parallel jobs (including IJobEntity, Query<T1>() and IJobChunk). If you know that two instances of a parallel job can never write to the same index in the container, you can disable the restriction on parallel writing by adding NativeDisableParallelForRestrictionAttribute to the TransformLookup field definition in the job struct.

    Properties

    Name Description
    this[Entity]

    Gets the TransformRef instance for the specified entity.

    Methods

    Name Description
    DidChange(Entity, uint)

    Reports whether any of TransformRef components in the chunk containing the specified Entity could have changed since a previous version.

    EntityExists(Entity)

    Reports whether the specified entity exists. Does not consider whether a TransformRef exists on the given entity.

    HasTransform(Entity)

    Reports whether the specified Entity instance still refers to a valid entity and that it has a transform component.

    HasTransform(Entity, out bool)

    Reports whether the specified Entity instance still refers to a valid entity and that it has a transform component.

    TryGetTransform(Entity, out TransformRef)

    Retrieves the transform components associated with the specified Entity, if it exists. The return value indicates whether the component was successfully retrieved.

    TryGetTransform(Entity, out TransformRef, out bool)

    Retrieves the transform components associated with the specified Entity, if it exists. The return value indicates whether the component was successfully retrieved.

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