Struct BufferLookup<T>
A [NativeContainer] that provides access to all instances of DynamicBuffer components with elements of type T, indexed by Entity.
Namespace: Unity.Entities
Assembly: solution.dll
Syntax
[NativeContainer]
public struct BufferLookup<T> where T : unmanaged, IBufferElementData
Type Parameters
Name | Description |
---|---|
T | The type of IBuffer |
Remarks
BufferLookup is a native container that provides array-like access to DynamicBuffer components of a specific type. For example, while iterating over a set of entities, you can use BufferLookup to get and set DynamicBuffers of unrelated entities.
To get a BufferLookup, call Get
Pass a BufferLookup container to a job by defining a public field of the appropriate type
in your IJob implementation. You can safely read from BufferLookup in any job, but by
default, you cannot write to components in the container in parallel jobs (including
IJob
Properties
Name | Description |
---|---|
this[Entity] | Gets the Dynamic |
Methods
Name | Description |
---|---|
Did |
Reports whether any of IBufferElementData components of the type T, in the chunk containing the specified Entity, could have changed. |
Has |
Reports whether the specified Entity instance still refers to a valid entity and that it has a buffer component of type T. |
Has |
Obsolete. Use Has |
Is |
Checks whether the IBuffer |
Is |
Obsolete. Use Is |
Set |
Enable or disable the IBuffer |
Set |
Obsolete. Use Set |
Try |
Retrieves the buffer components associated with the specified Entity, if it exists. Then reports if the instance still refers to a valid entity and that it has a buffer component of type T. |
Update(System |
When a BufferLookup 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 type handle safe to use. |
Update(ref System |
When a BufferLookup 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 type handle safe to use. |