使用整数的 2D 向量和点表示形式。
此结构用于在某些情况下表示不需要浮点精度的 2D 位置和向量。
| down | Shorthand for writing Vector2Int(0, -1). |
| left | Shorthand for writing Vector2Int(-1, 0). |
| one | Shorthand for writing Vector2Int(1, 1). |
| right | Shorthand for writing Vector2Int(1, 0). |
| up | Shorthand for writing Vector2Int(0, 1). |
| zero | Shorthand for writing Vector2Int(0, 0). |
| magnitude | 返回该向量的长度。(只读) |
| sqrMagnitude | 返回该向量的平方长度。(只读) |
| this[int] | 分别使用 [0] 或 [1] 访问 x 或 y 分量。 |
| x | 向量的 X 分量。 |
| y | 向量的 Y 分量。 |
| Clamp | 将 Vector2Int 限制在 min 和 max 给定的边界内。 |
| Equals | 如果对象相等,则返回 true。 |
| GetHashCode | 获取 Vector2Int 的哈希代码。 |
| Set | 设置现有 Vector2Int 的 x 和 y 分量。 |
| ToString | Returns a formatted string for this vector. |
| CeilToInt | 通过对每个值执行 Ceiling 操作将 Vector2 转换为 Vector2Int。 |
| Distance | 返回 a 与 b 之间的距离。 |
| FloorToInt | 通过对每个值执行 Floor 操作将 Vector2 转换为 Vector2Int。 |
| Max | 返回由两个向量的最大分量组成的向量。 |
| Min | 返回由两个向量的最小分量组成的向量。 |
| RoundToInt | 通过对每个值执行 Round 操作将 Vector2 转换为 Vector2Int。 |
| Scale | 将两个向量的分量相乘。 |
| operator - | 将一个向量减去另一个向量。 |
| operator != | 如果向量不同,则返回 true。 |
| operator * | 将向量乘以一个数值。 |
| operator / | 将向量除以一个数值。 |
| operator + | 将两个向量相加。 |
| operator == | 如果向量相等,则返回 true。 |
| Unknown operator | 将 Vector2Int 转换为 Vector3Int。 |
| Vector2 | 将 Vector2Int 转换为 Vector2。 |