Skip to content

Commit

Permalink
Add conversion extensions for Vector2/3Ints
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanite committed Jan 11, 2025
1 parent a521a91 commit 5da9b87
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Utilities/MathUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,21 @@ public static Vector3 Xy1(this Vector2 value)
return new Vector3(value.X, value.Y, 1);
}

public static Vector2Int Xy(this Vector3Int value)
{
return new Vector2Int(value.X, value.Y);
}

public static Vector3Int Xy0(this Vector2Int value)
{
return new Vector3Int(value.X, value.Y, 0);
}

public static Vector3Int Xy1(this Vector2Int value)
{
return new Vector3Int(value.X, value.Y, 1);
}

public static Vector2 ClampMagnitude(Vector2 value, float maxLength)
{
return ClampMagnitude(value, 0, maxLength);
Expand Down

0 comments on commit 5da9b87

Please sign in to comment.