Description
The Vector3Int.OneY
field is a static member of the Vector3Int
struct. It represents an integer vector where the Y component is set to 1, and the X and Z components are set to 0. This field is useful for operations that require a unit vector along the Y-axis in a 3D integer space.
Usage
You can use Vector3Int.OneY
when you need a vector that points in the positive Y direction. This is particularly useful in scenarios involving directional calculations, grid-based movement, or when you need a standard basis vector for the Y-axis.
Example
// Example of using Vector3Int.OneY
Vector3Int direction = Vector3Int.OneY;
// This can be used to move an object up by one unit in a grid-based system
Vector3Int position = new Vector3Int(0, 0, 0);
position += direction; // position is now (0, 1, 0)