Hello all,
I’ve got a Vector2 array that I built in C# like so:
public Vector2[] vecArray;
vecArray = new Vector2[]
{
new Vector2( 0, 0 ),
new Vector2( 0, 0 ),
};
Now I’m able to assign values to it like this:
vecArray[0] = new Vector2( 1, 1 );
However I’d like to be able to assign to it without creating a new Vector2 each time. Something like:
vecArray[0] = Vector2( 1, 1 );
This line of course isn’t valid, but is there some way to do this? I’m trying to avoid making garbage. If this were another array type (like int) I could assign directly to it or make a var outside that I reuse instead of making a new one each time. Does this seem reasonable or am I missing something here? ![]()
Thanks for any input,
-d