# WithAny

> Specify optional read-only component types (which must be enabled).

## Definition

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

## WithAny\<T>()

Specify optional read-only component types (which must be enabled).

```csharp
public QueryEnumerable<T1, T2, T3> WithAny<TComponent1>()
```

### Returns

| Type                                                                                            | Description                                                                                                                                 |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [QueryEnumerable\<T, U, V>](/engine/7000.0/script-reference/unity/entities/queryenumerable3.md) | QueryEnumerable, which allows enumerating over all RefRO, RefRW, EnabledRefRO and EnabledRefRW components that match the constructed Query. |

## WithAny\<T, U>()

Specify optional read-only component types (which must be enabled).

```csharp
public QueryEnumerable<T1, T2, T3> WithAny<TComponent1, TComponent2>()
```

### Returns

| Type                                                                                            | Description                                                                                                                                 |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [QueryEnumerable\<T, U, V>](/engine/7000.0/script-reference/unity/entities/queryenumerable3.md) | QueryEnumerable, which allows enumerating over all RefRO, RefRW, EnabledRefRO and EnabledRefRW components that match the constructed Query. |

## WithAny\<T, U, V>()

Specify optional read-only component types (which must be enabled).

```csharp
public QueryEnumerable<T1, T2, T3> WithAny<TComponent1, TComponent2, TComponent3>()
```

### Returns

| Type                                                                                            | Description                                                                                                                                 |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [QueryEnumerable\<T, U, V>](/engine/7000.0/script-reference/unity/entities/queryenumerable3.md) | QueryEnumerable, which allows enumerating over all RefRO, RefRW, EnabledRefRO and EnabledRefRW components that match the constructed Query. |
