# GetSingletonBuffer<T>(bool)

> Gets the value of a singleton buffer component.

## Definition

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

```csharp
public static DynamicBuffer<T> GetSingletonBuffer<T>(bool isReadOnly = false) where T : unmanaged, IBufferElementData
```

### Parameters

**** (\[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 buffer. |

### Remarks

Not working in Entities.ForEach, IJobEntity, and Utility methods

Additional Resources: [EntityQuery.GetSingleton](/engine/7000.0/script-reference/unity/entities/entityquery/getsingleton.md)
