FloorToInt
Converts a Vector2 to a Vector2Int by doing a Floor to each value.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
FloorToInt(Vector2)
Converts a Vector2 to a Vector2Int by doing a Floor to each value.
public static Vector2Int FloorToInt(Vector2 v)
Parameters
The Vector2 to convert.
Returns
Type | Description |
|---|---|
| Vector2Int | The converted Vector2 as a Vector2Int. |
Remarks
As there is a conversion of float to integer, there is a loss of precision.
FloorToInt(Vector2)
Converts a Vector2 to a Vector2Int by doing a Floor to each value.
public static Vector2Int FloorToInt(in Vector2 v)
Parameters
The Vector2 to convert.
Returns
Type | Description |
|---|---|
| Vector2Int | The converted Vector2 as a Vector2Int. |
Remarks
As there is a conversion of float to integer, there is a loss of precision.