I am doing an extension for the Vector2 class. In my main code, I can say
Vector2 v=new Vector2();
v.X=2;
But in my extension I canβt.
public static void SetToThree(this Vector2 vector)
{
vector.X=3;
}
v.SetToThree () does not change v. When I go through the line through the code, in the extension vector X, the direction changes to 3, but after the extension was completed and the main code continued, v did not change at all. Is there a way for the SetToThree extension method to change the value of v?
source
share