Method TryGetBuffer
TryGetBuffer(Entity, out DynamicBuffer<T>)
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.
Declaration
public bool TryGetBuffer(Entity entity, out DynamicBuffer<T> bufferData)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity. |
DynamicBuffer<T> | bufferData | The buffer component of type T for the given entity, if it exists. |
Returns
Type | Description |
---|---|
bool | True if the entity has a buffer component of type T, and false if it does not. |
TryGetBuffer(Entity, out DynamicBuffer<T>, out bool)
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.
Declaration
public bool TryGetBuffer(Entity entity, out DynamicBuffer<T> bufferData, out bool entityExists)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity. |
DynamicBuffer<T> | bufferData | The buffer component of type T for the given entity, if it exists. |
bool | entityExists | Denotes whether the given entity exists. Use to distinguish entity non-existence from buffer non-existence. |
Returns
Type | Description |
---|---|
bool | True if the entity has a buffer component of type T, and false if it does not. |