Struct float2
A 2 component vector of floats.
Inherited Members
Namespace: Unity.Mathematics
Assembly: Unity.Mathematics.dll
Syntax
[Serializable]
public struct float2 : IEquatable<float2>, IFormattable
  Constructors
| Name | Description | 
|---|---|
| float2(bool) | Constructs a float2 vector from a single bool value by converting it to float and assigning it to every component.  | 
      
| float2(double) | Constructs a float2 vector from a single double value by converting it to float and assigning it to every component.  | 
      
| float2(int) | Constructs a float2 vector from a single int value by converting it to float and assigning it to every component.  | 
      
| float2(float) | Constructs a float2 vector from a single float value by assigning it to every component.  | 
      
| float2(float, float) | Constructs a float2 vector from two float values.  | 
      
| float2(uint) | Constructs a float2 vector from a single uint value by converting it to float and assigning it to every component.  | 
      
| float2(bool2) | Constructs a float2 vector from a bool2 vector by componentwise conversion.  | 
      
| float2(double2) | Constructs a float2 vector from a double2 vector by componentwise conversion.  | 
      
| float2(float2) | Constructs a float2 vector from a float2 vector.  | 
      
| float2(half) | Constructs a float2 vector from a single half value by converting it to float and assigning it to every component.  | 
      
| float2(half2) | Constructs a float2 vector from a half2 vector by componentwise conversion.  | 
      
| float2(int2) | Constructs a float2 vector from a int2 vector by componentwise conversion.  | 
      
| float2(uint2) | Constructs a float2 vector from a uint2 vector by componentwise conversion.  | 
      
Fields
| Name | Description | 
|---|---|
| x | x component of the vector.  | 
      
| y | y component of the vector.  | 
      
| zero | float2 zero value.  | 
      
Properties
| Name | Description | 
|---|---|
| this[int] | Returns the float element at a specified index.  | 
      
Methods
| Name | Description | 
|---|---|
| Equals(object) | Returns true if the float2 is equal to a given float2, false otherwise.  | 
      
| Equals(float2) | Returns true if the float2 is equal to a given float2, false otherwise.  | 
      
| GetHashCode() | Returns a hash code for the float2.  | 
      
| ToString() | Returns a string representation of the float2.  | 
      
| ToString(string, IFormatProvider) | Returns a string representation of the float2 using a specified format and culture-specific format information.  | 
      
Operators
| Name | Description | 
|---|---|
| operator +(float, float2) | Returns the result of a componentwise addition operation on a float value and a float2 vector.  | 
      
| operator +(float2, float) | Returns the result of a componentwise addition operation on a float2 vector and a float value.  | 
      
| operator +(float2, float2) | Returns the result of a componentwise addition operation on two float2 vectors.  | 
      
| operator --(float2) | Returns the result of a componentwise decrement operation on a float2 vector.  | 
      
| operator /(float, float2) | Returns the result of a componentwise division operation on a float value and a float2 vector.  | 
      
| operator /(float2, float) | Returns the result of a componentwise division operation on a float2 vector and a float value.  | 
      
| operator /(float2, float2) | Returns the result of a componentwise division operation on two float2 vectors.  | 
      
| operator ==(float, float2) | Returns the result of a componentwise equality operation on a float value and a float2 vector.  | 
      
| operator ==(float2, float) | Returns the result of a componentwise equality operation on a float2 vector and a float value.  | 
      
| operator ==(float2, float2) | Returns the result of a componentwise equality operation on two float2 vectors.  | 
      
| explicit operator float2(bool) | Explicitly converts a single bool value to a float2 vector by converting it to float and assigning it to every component.  | 
      
| explicit operator float2(double) | Explicitly converts a single double value to a float2 vector by converting it to float and assigning it to every component.  | 
      
| explicit operator float2(bool2) | Explicitly converts a bool2 vector to a float2 vector by componentwise conversion.  | 
      
| explicit operator float2(double2) | Explicitly converts a double2 vector to a float2 vector by componentwise conversion.  | 
      
| operator >(float, float2) | Returns the result of a componentwise greater than operation on a float value and a float2 vector.  | 
      
| operator >(float2, float) | Returns the result of a componentwise greater than operation on a float2 vector and a float value.  | 
      
| operator >(float2, float2) | Returns the result of a componentwise greater than operation on two float2 vectors.  | 
      
| operator >=(float, float2) | Returns the result of a componentwise greater or equal operation on a float value and a float2 vector.  | 
      
| operator >=(float2, float) | Returns the result of a componentwise greater or equal operation on a float2 vector and a float value.  | 
      
| operator >=(float2, float2) | Returns the result of a componentwise greater or equal operation on two float2 vectors.  | 
      
| implicit operator float2(int) | Implicitly converts a single int value to a float2 vector by converting it to float and assigning it to every component.  | 
      
| implicit operator float2(float) | Implicitly converts a single float value to a float2 vector by assigning it to every component.  | 
      
| implicit operator float2(uint) | Implicitly converts a single uint value to a float2 vector by converting it to float and assigning it to every component.  | 
      
| implicit operator Vector2(float2) | Converts a float2 to Vector2.  | 
      
| implicit operator float2(half) | Implicitly converts a single half value to a float2 vector by converting it to float and assigning it to every component.  | 
      
| implicit operator float2(half2) | Implicitly converts a half2 vector to a float2 vector by componentwise conversion.  | 
      
| implicit operator float2(int2) | Implicitly converts a int2 vector to a float2 vector by componentwise conversion.  | 
      
| implicit operator float2(uint2) | Implicitly converts a uint2 vector to a float2 vector by componentwise conversion.  | 
      
| implicit operator float2(Vector2) | Converts a Vector2 to float2.  | 
      
| operator ++(float2) | Returns the result of a componentwise increment operation on a float2 vector.  | 
      
| operator !=(float, float2) | Returns the result of a componentwise not equal operation on a float value and a float2 vector.  | 
      
| operator !=(float2, float) | Returns the result of a componentwise not equal operation on a float2 vector and a float value.  | 
      
| operator !=(float2, float2) | Returns the result of a componentwise not equal operation on two float2 vectors.  | 
      
| operator <(float, float2) | Returns the result of a componentwise less than operation on a float value and a float2 vector.  | 
      
| operator <(float2, float) | Returns the result of a componentwise less than operation on a float2 vector and a float value.  | 
      
| operator <(float2, float2) | Returns the result of a componentwise less than operation on two float2 vectors.  | 
      
| operator <=(float, float2) | Returns the result of a componentwise less or equal operation on a float value and a float2 vector.  | 
      
| operator <=(float2, float) | Returns the result of a componentwise less or equal operation on a float2 vector and a float value.  | 
      
| operator <=(float2, float2) | Returns the result of a componentwise less or equal operation on two float2 vectors.  | 
      
| operator %(float, float2) | Returns the result of a componentwise modulus operation on a float value and a float2 vector.  | 
      
| operator %(float2, float) | Returns the result of a componentwise modulus operation on a float2 vector and a float value.  | 
      
| operator %(float2, float2) | Returns the result of a componentwise modulus operation on two float2 vectors.  | 
      
| operator *(float, float2) | Returns the result of a componentwise multiplication operation on a float value and a float2 vector.  | 
      
| operator *(float2, float) | Returns the result of a componentwise multiplication operation on a float2 vector and a float value.  | 
      
| operator *(float2, float2) | Returns the result of a componentwise multiplication operation on two float2 vectors.  | 
      
| operator -(float, float2) | Returns the result of a componentwise subtraction operation on a float value and a float2 vector.  | 
      
| operator -(float2, float) | Returns the result of a componentwise subtraction operation on a float2 vector and a float value.  | 
      
| operator -(float2, float2) | Returns the result of a componentwise subtraction operation on two float2 vectors.  | 
      
| operator -(float2) | Returns the result of a componentwise unary minus operation on a float2 vector.  | 
      
| operator +(float2) | Returns the result of a componentwise unary plus operation on a float2 vector.  |