Vector2Int ComponentMax( Vector2Int other )

book_4_sparkGenerated
code_blocksInput

Description

The ComponentMax method of the Vector2Int struct returns a new Vector2Int where each component is the maximum of the corresponding components of the current vector and the specified other vector. This method is useful for comparing two vectors and creating a new vector that represents the maximum bounds in each dimension.

Usage

To use the ComponentMax method, call it on an instance of Vector2Int and pass another Vector2Int as the parameter. The method will return a new Vector2Int with the maximum values for each component.

Example

Vector2Int vector1 = new Vector2Int(3, 5);
Vector2Int vector2 = new Vector2Int(4, 2);
Vector2Int result = vector1.ComponentMax(vector2);
// result is now (4, 5)