The Max
method in the Vector3Int
struct is a static method that returns a new Vector3Int
instance. This instance contains the maximum values for each component (x, y, z) from the two provided Vector3Int
instances, a
and b
.
The Max
method in the Vector3Int
struct is a static method that returns a new Vector3Int
instance. This instance contains the maximum values for each component (x, y, z) from the two provided Vector3Int
instances, a
and b
.
Use the Max
method when you need to determine the maximum component values between two Vector3Int
instances. This can be useful in scenarios where you need to ensure that a vector's components are at least as large as those of another vector.
Vector3Int vectorA = new Vector3Int(1, 5, 3); Vector3Int vectorB = new Vector3Int(4, 2, 6); Vector3Int maxVector = Vector3Int.Max(vectorA, vectorB); // maxVector is now (4, 5, 6)