# GetBuffer<T>(Entity, bool)

> Gets the dynamic buffer of an entity.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

> **Warning:**
>
> **Deprecated.** Use SystemAPI.GetBuffer instead (RemovedAfter Entities 1.0)

```csharp
public DynamicBuffer<T> GetBuffer<T>(Entity entity, bool isReadOnly = false) where T : unmanaged, IBufferElementData
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether the buffer data is only read or is also written. Access data in a read-only fashion whenever possible.

### Returns

| Type                                                                                  | Description                                                 |
| ------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md) | The DynamicBuffer object for accessing the buffer contents. |

### Remarks

When you call this method on the main thread, it invokes [EntityManager.GetBuffer](/engine/7000.0/script-reference/unity/entities/entitymanager/getbuffer.md).
