# GetEnabledRefROOptional<T2>(Entity)

> Gets a safe reference to the component enabled state.

## Definition

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

## GetEnabledRefROOptional\<T>(Entity)

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

### Parameters

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

### Returns

| Type                                                                                | Description                                                                                                                                                                                     |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [EnabledRefRO\<T>](/engine/7000.0/script-reference/unity/entities/enabledrefro1.md) | Returns a safe reference to the component enabled state. If the component doesn't exist, returns a default [EnabledRefRO\<T>](/engine/7000.0/script-reference/unity/entities/enabledrefro1.md). |
