Description
The Vector3Int.OneY
field is a static, read-only field of type Vector3Int
. 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
whenever you need a vector that points in the positive Y direction with a magnitude of 1. This is particularly useful in scenarios involving directional calculations, grid-based movement, or when you need a standard basis vector along the Y-axis.
Example
// Example usage of Vector3Int.OneY
Vector3Int direction = Vector3Int.OneY;
// This can be used to move an object up by one unit in a grid-based system
Vector3Int currentPosition = new Vector3Int(0, 0, 0);
Vector3Int newPosition = currentPosition + direction;
// newPosition will be (0, 1, 0)