Method GetBuffer
GetBuffer<T>(Entity, bool)
Gets the dynamic buffer of an entity.
Declaration
public DynamicBuffer<T> GetBuffer<T>(Entity entity, bool isReadOnly = false) where T : unmanaged, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity. |
bool | isReadOnly | Specify whether the access to the component through this object is read only or read and write. |
Returns
Type | Description |
---|---|
DynamicBuffer<T> | The DynamicBuffer object for accessing the buffer contents. |
Type Parameters
Name | Description |
---|---|
T | The type of the buffer's elements. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if T is an unsupported type. |
GetBuffer<T>(SystemHandle, bool)
Gets the dynamic buffer of an entity associated with a system.
Declaration
public DynamicBuffer<T> GetBuffer<T>(SystemHandle system, bool isReadOnly = false) where T : unmanaged, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
SystemHandle | system | The system handle. |
bool | isReadOnly | Specify whether the access to the component through this object is read only or read and write. |
Returns
Type | Description |
---|---|
DynamicBuffer<T> | The DynamicBuffer object for accessing the buffer contents. |
Type Parameters
Name | Description |
---|---|
T | The type of the buffer's elements. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if T is an unsupported type. |