How to call extension method as a static member

Viewed 56

I have some code to simplify Vector2

public static Vector2 Vector2X (this Vector2 vector, float x) => new Vector2 (x, vector.y);
public static Vector2 Vector2Y (this Vector2 vector, float y) => new Vector2 (vector.x, y);
public static Vector2 Vector2XY (this Vector2 vector, float x, float y) => new Vector2 (x, y);

How can I Call them as a static member something like this, Vector2.Vector2X (0); instead of Vector2 instance; instance.Vector2X(0);

0 Answers
Related