A [NativeContainer] that provides access to all instances of TransformRef components, indexed by Entity.
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 SystemState.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, SystemAPI.Query 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.
[NativeContainer]: https://docs.unity3d.com/ScriptReference/Unity.Collections.LowLevel.Unsafe.NativeContainerAttribute
[NativeDisableParallelForRestrictionAttribute]: https://docs.unity3d.com/ScriptReference/Unity.Collections.NativeDisableParallelForRestrictionAttribute.html
| Property | Description |
|---|---|
| this[Entity] | Gets the TransformRef instance for the specified entity. |
| Method | Description |
|---|---|
| DidChange | Reports whether any of TransformRef components in the chunk containing the specified Entity could have changed since a previous version. |
| EntityExists | Reports whether the specified entity exists. Does not consider whether a TransformRef exists on the given entity. |
| HasTransform | Reports whether the specified Entity instance still refers to a valid entity and that it has a transform component. |
| TryGetTransform | Retrieves the transform components associated with the specified Entity, if it exists. The return value indicates whether the component was successfully retrieved. |
| Update | When a TransformLookup is cached by a system across multiple system updates, calling this function inside the system's OnUpdate() method performs the minimal incremental updates necessary to make the lookup safe to use. |