# ReadWrite

> Returns a ComponentType with ComponentType.AccessMode.ReadWrite based on the generic type T.

## Definition

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

## ReadWrite\<T>()

Returns a [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) with [ComponentType.AccessMode.ReadWrite](/engine/7000.0/script-reference/unity/entities/componenttype/accessmode/readwrite.md) based on the generic type T.

```csharp
public static ComponentType ReadWrite<T>()
```

### Returns

| Type                                                                             | Description        |
| -------------------------------------------------------------------------------- | ------------------ |
| [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) | The component type |

## ReadWrite(Type)

Returns a [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) with [ComponentType.AccessMode.ReadWrite](/engine/7000.0/script-reference/unity/entities/componenttype/accessmode/readwrite.md) based on the type.

```csharp
[ExcludeFromBurstCompatTesting("Takes a managed Type")]
public static ComponentType ReadWrite(Type type)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The type

### Returns

| Type                                                                             | Description        |
| -------------------------------------------------------------------------------- | ------------------ |
| [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) | The component type |

## ReadWrite(TypeIndex)

Returns a [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) with [ComponentType.AccessMode.ReadWrite](/engine/7000.0/script-reference/unity/entities/componenttype/accessmode/readwrite.md) based on the typeIndex.

```csharp
public static ComponentType ReadWrite(TypeIndex typeIndex)
```

### Parameters

**** (\[TypeIndex]\(/engine/7000.0/script-reference/unity/entities/typeindex)): The index

### Returns

| Type                                                                             | Description        |
| -------------------------------------------------------------------------------- | ------------------ |
| [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) | The component type |
