# GetEnabledRefRW<T2>(Entity)

> Gets a safe reference to the buffer component enabled state.

## Definition

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

## GetEnabledRefRW\<T>(Entity)

```csharp
public EnabledRefRW<T2> GetEnabledRefRW<T2>(Entity entity) where T2 : unmanaged, IEnableableComponent, IBufferElementData
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The referenced entity

### Returns

| Type                                                                                | Description                                                                                                  |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [EnabledRefRW\<T>](/engine/7000.0/script-reference/unity/entities/enabledrefrw1.md) | Returns a safe reference to the component enabled state. Throws an exception if the component doesn't exist. |
