mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-23 00:18:47 +00:00
Add Vector2/3Int.ToSystemVector
This commit is contained in:
parent
2b8f763184
commit
43a155ad90
@ -40,10 +40,12 @@
|
||||
- X10D.Unity: Added `Vector2Int.Deconstruct()`
|
||||
- X10D.Unity: Added `Vector2Int.ToSystemPoint()`
|
||||
- X10D.Unity: Added `Vector2Int.ToSystemSize()`
|
||||
- X10D.Unity: Added `Vector2Int.ToSystemVector()`
|
||||
- X10D.Unity: Added `Vector2Int.WithX()`
|
||||
- X10D.Unity: Added `Vector2Int.WithY()`
|
||||
- X10D.Unity: Added `Vector3.Deconstruct()`
|
||||
- X10D.Unity: Added `Vector3Int.Deconstruct()`
|
||||
- X10D.Unity: Added `Vector3Int.ToSystemVector()`
|
||||
- X10D.Unity: Added `Vector3Int.WithX()`
|
||||
- X10D.Unity: Added `Vector3Int.WithY()`
|
||||
- X10D.Unity: Added `Vector3Int.WithZ()`
|
||||
|
@ -46,6 +46,18 @@ public static class Vector2IntExtensions
|
||||
return new Size(vector.x, vector.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the current vector to a <see cref="System.Numerics.Vector2" />.
|
||||
/// </summary>
|
||||
/// <param name="vector">The vector to convert.</param>
|
||||
/// <returns>The converted vector.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static System.Numerics.Vector2 ToSystemVector(this Vector2Int vector)
|
||||
{
|
||||
return new System.Numerics.Vector2(vector.x, vector.y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a vector whose Y component is the same as the specified vector, and whose X component is a new value.
|
||||
/// </summary>
|
||||
|
@ -23,6 +23,18 @@ public static class Vector3IntExtensions
|
||||
z = vector.z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the current vector to a <see cref="System.Numerics.Vector3" />.
|
||||
/// </summary>
|
||||
/// <param name="vector">The vector to convert.</param>
|
||||
/// <returns>The converted vector.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static System.Numerics.Vector3 ToSystemVector(this Vector3Int vector)
|
||||
{
|
||||
return new System.Numerics.Vector3(vector.x, vector.y, vector.z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a vector whose Y and Z components are the same as the specified vector, and whose X component is a new value.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user