For some reason (I'm new to C # and know java and C ++). C # saves copies of objects when I want to pass a value. I have an arraylist of class Vector2 , and whenever I want to increase the value, I have to do this:
Vector2 d = (Vector2) myObjects[i]; d.Y++; myObjects [i] = d;
I want to be able to do this:
Vector2 d = (Vector2) myObjects[i]; d.Y++;
and do it. I searched the Internet and, surprisingly, no answers. BTW vector is a structure.
source share