Closed oliverbooth closed 2 years ago
Types
System.Numerics.Vector2 System.Numerics.Vector3 System.Numerics.Vector4 UnityEngine.Vector2 UnityEngine.Vector3 UnityEngine.Vector4
Extension method signatures
Vector2 WithX(float); Vector2 WithY(float); Vector3 WithX(float); Vector3 WithY(float); Vector3 WithZ(float); Vector4 WithX(float); Vector4 WithY(float); Vector4 WithZ(float); Vector4 WithW(float);
float
Description Returns a vector whose components are the same as a given vector, but with one component specified as a new value.
Benefits Provides an easy way to transform a Vector2/3/4 without constructing a new one.
Vector2/3/4
Drawbacks This is already easily achievable using a with expression, since Vector2/3/4 are mutable.
with
(Optional) Implementation example n/a
Types
Extension method signatures
float
Description Returns a vector whose components are the same as a given vector, but with one component specified as a new value.
Benefits Provides an easy way to transform a
Vector2/3/4
without constructing a new one.Drawbacks This is already easily achievable using a
with
expression, since Vector2/3/4 are mutable.(Optional) Implementation example n/a