Class Vector2Extensions
Unity Vector2 extension methods.
Inheritance
System.Object
Vector2Extensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Extensions
Assembly: cs.temp.dll.dll
Syntax
public static class Vector2Extensions
Methods
MultipliedBy(in Vector2, Single)
Multiplies each element in Vector2 by the given scalar.
Declaration
public static Vector2 MultipliedBy(this in Vector2 a, float s)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | a | The current vector. |
| System.Single | s | The given scalar. |
Returns
| Type | Description |
|---|---|
| Vector2 | Returns new Vector2 containing the multiplied components. |
MultipliedBy(in Vector2, Vector2)
Multiplies each element in Vector2 a by the corresponding element of b.
Declaration
public static Vector2 MultipliedBy(this in Vector2 a, Vector2 b)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | a | The current vector. |
| Vector2 | b | The given vector. |
Returns
| Type | Description |
|---|---|
| Vector2 | Returns new Vector2 containing the multiplied components of the given vectors. |
SqrDistance(in Vector2, in Vector2)
Calculates a squared distance between current and given vectors.
Declaration
public static float SqrDistance(this in Vector2 a, in Vector2 b)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | a | The current vector. |
| Vector2 | b | The given vector. |
Returns
| Type | Description |
|---|---|
| System.Single | Returns squared distance between current and given vectors. |