Description
The Vector2Int.Left
field is a static, public field of type Vector2Int
. It represents a directional vector pointing to the left, with the X component set to -1 and the Y component set to 0. This field is useful for operations that require a consistent representation of the left direction in a 2D integer vector space.
Usage
Use Vector2Int.Left
when you need a predefined vector that points to the left in a 2D grid or coordinate system. This can be particularly useful in game development for moving objects or characters leftward, or for calculations involving directional vectors.
Example
// Example of using Vector2Int.Left
// Create a new position vector
Vector2Int position = new Vector2Int(5, 5);
// Move the position to the left by one unit
position += Vector2Int.Left;
// Output the new position
// Expected output: (4, 5)
var newPosition = position;