# GetOptionalEnabledRefRW<T>(int)

> Get a EnabledRefRW<T> reference to the enabled bit at index. Returns EnabledRefRORW\<T\>.Null if this EnabledMask is not valid.

## Definition

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

```csharp
public EnabledRefRW<T> GetOptionalEnabledRefRW<T>(int index) where T : unmanaged, IEnableableComponent
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index to the enabled bit in the chunk.

### Returns

| Type                                                                                | Description                                                                                                                                                                                                                                                                 |
| ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [EnabledRefRW\<T>](/engine/7000.0/script-reference/unity/entities/enabledrefrw1.md) | A reference to the enabled bit for the component at the specified index or [EnabledRefRW\<T>.Null](/engine/7000.0/script-reference/unity/entities/enabledrefrw1/null.md) if this [EnabledMask](/engine/7000.0/script-reference/unity/entities/enabledmask.md) is not valid. |
