# bool2

> A 2 component vector of bools.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Mathematics](/engine/6000.7/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule
* **Implements:** [IEquatable\<bool2>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct bool2 : IEquatable<bool2>
```

## Fields

| Value                                                             | Description                |
| ----------------------------------------------------------------- | -------------------------- |
| [x](/engine/6000.7/script-reference/unity/mathematics/bool2/x.md) | x component of the vector. |
| [y](/engine/6000.7/script-reference/unity/mathematics/bool2/y.md) | y component of the vector. |

## Constructors

| Constructor                                                                                                                | Description                                                                            |
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| [bool2(System.Boolean)](/engine/6000.7/script-reference/unity/mathematics/bool2/ctor.md#bool2\(bool\))                     | Constructs a bool2 vector from a single bool value by assigning it to every component. |
| [bool2(System.Boolean,System.Boolean)](/engine/6000.7/script-reference/unity/mathematics/bool2/ctor.md#bool2\(bool-bool\)) | Constructs a bool2 vector from two bool values.                                        |
| [bool2(Unity.Mathematics.bool2)](/engine/6000.7/script-reference/unity/mathematics/bool2/ctor.md#bool2\(bool2\))           | Constructs a bool2 vector from a bool2 vector.                                         |

## Properties

| Property                                                                    | Description                                    |
| --------------------------------------------------------------------------- | ---------------------------------------------- |
| [this\[\]](/engine/6000.7/script-reference/unity/mathematics/bool2/item.md) | Returns the bool element at a specified index. |
| [xx](/engine/6000.7/script-reference/unity/mathematics/bool2/xx.md)         | Swizzles the vector.                           |
| [xxx](/engine/6000.7/script-reference/unity/mathematics/bool2/xxx.md)       | Swizzles the vector.                           |
| [xxxx](/engine/6000.7/script-reference/unity/mathematics/bool2/xxxx.md)     | Swizzles the vector.                           |
| [xxxy](/engine/6000.7/script-reference/unity/mathematics/bool2/xxxy.md)     | Swizzles the vector.                           |
| [xxy](/engine/6000.7/script-reference/unity/mathematics/bool2/xxy.md)       | Swizzles the vector.                           |
| [xxyx](/engine/6000.7/script-reference/unity/mathematics/bool2/xxyx.md)     | Swizzles the vector.                           |
| [xxyy](/engine/6000.7/script-reference/unity/mathematics/bool2/xxyy.md)     | Swizzles the vector.                           |
| [xy](/engine/6000.7/script-reference/unity/mathematics/bool2/xy.md)         | Swizzles the vector.                           |
| [xyx](/engine/6000.7/script-reference/unity/mathematics/bool2/xyx.md)       | Swizzles the vector.                           |
| [xyxx](/engine/6000.7/script-reference/unity/mathematics/bool2/xyxx.md)     | Swizzles the vector.                           |
| [xyxy](/engine/6000.7/script-reference/unity/mathematics/bool2/xyxy.md)     | Swizzles the vector.                           |
| [xyy](/engine/6000.7/script-reference/unity/mathematics/bool2/xyy.md)       | Swizzles the vector.                           |
| [xyyx](/engine/6000.7/script-reference/unity/mathematics/bool2/xyyx.md)     | Swizzles the vector.                           |
| [xyyy](/engine/6000.7/script-reference/unity/mathematics/bool2/xyyy.md)     | Swizzles the vector.                           |
| [yx](/engine/6000.7/script-reference/unity/mathematics/bool2/yx.md)         | Swizzles the vector.                           |
| [yxx](/engine/6000.7/script-reference/unity/mathematics/bool2/yxx.md)       | Swizzles the vector.                           |
| [yxxx](/engine/6000.7/script-reference/unity/mathematics/bool2/yxxx.md)     | Swizzles the vector.                           |
| [yxxy](/engine/6000.7/script-reference/unity/mathematics/bool2/yxxy.md)     | Swizzles the vector.                           |
| [yxy](/engine/6000.7/script-reference/unity/mathematics/bool2/yxy.md)       | Swizzles the vector.                           |
| [yxyx](/engine/6000.7/script-reference/unity/mathematics/bool2/yxyx.md)     | Swizzles the vector.                           |
| [yxyy](/engine/6000.7/script-reference/unity/mathematics/bool2/yxyy.md)     | Swizzles the vector.                           |
| [yy](/engine/6000.7/script-reference/unity/mathematics/bool2/yy.md)         | Swizzles the vector.                           |
| [yyx](/engine/6000.7/script-reference/unity/mathematics/bool2/yyx.md)       | Swizzles the vector.                           |
| [yyxx](/engine/6000.7/script-reference/unity/mathematics/bool2/yyxx.md)     | Swizzles the vector.                           |
| [yyxy](/engine/6000.7/script-reference/unity/mathematics/bool2/yyxy.md)     | Swizzles the vector.                           |
| [yyy](/engine/6000.7/script-reference/unity/mathematics/bool2/yyy.md)       | Swizzles the vector.                           |
| [yyyx](/engine/6000.7/script-reference/unity/mathematics/bool2/yyyx.md)     | Swizzles the vector.                           |
| [yyyy](/engine/6000.7/script-reference/unity/mathematics/bool2/yyyy.md)     | Swizzles the vector.                           |

## Methods

| Method                                                                                | Description                                                           |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| [Equals](/engine/6000.7/script-reference/unity/mathematics/bool2/equals.md)           | Returns true if the bool2 is equal to a given bool2, false otherwise. |
| [GetHashCode](/engine/6000.7/script-reference/unity/mathematics/bool2/gethashcode.md) | Returns a hash code for the bool2.                                    |
| [ToString](/engine/6000.7/script-reference/unity/mathematics/bool2/tostring.md)       | Returns a string representation of the bool2.                         |

## Operators

| Operator                                                                                | Description                                                                                              |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [operator &](/engine/6000.7/script-reference/unity/mathematics/bool2/op-bitwiseand.md)  | Returns the result of a componentwise bitwise and operation on a bool value and a bool2 vector.          |
| [operator \|](/engine/6000.7/script-reference/unity/mathematics/bool2/op-bitwiseor.md)  | Returns the result of a componentwise bitwise or operation on a bool value and a bool2 vector.           |
| [operator ==](/engine/6000.7/script-reference/unity/mathematics/bool2/op-equality.md)   | Returns the result of a componentwise equality operation on a bool value and a bool2 vector.             |
| [operator ^](/engine/6000.7/script-reference/unity/mathematics/bool2/op-exclusiveor.md) | Returns the result of a componentwise bitwise exclusive or operation on a bool value and a bool2 vector. |
| [bool2](/engine/6000.7/script-reference/unity/mathematics/bool2/op-implicit.md)         | Implicitly converts a single bool value to a bool2 vector by assigning it to every component.            |
| [operator !=](/engine/6000.7/script-reference/unity/mathematics/bool2/op-inequality.md) | Returns the result of a componentwise not equal operation on a bool value and a bool2 vector.            |
| [operator !](/engine/6000.7/script-reference/unity/mathematics/bool2/op-logicalnot.md)  | Returns the result of a componentwise not operation on a bool2 vector.                                   |
