In Unity you have to deal with Vector2
and Vector3
values many time in your code. Both are structs, which means when you make your code modular with small functions every time you pass such values to a function argument you copy them. Yes, you copy them in the stack but still we could make less work if we could pass it's reference. Can we pass value type to a function by reference without dealing with boxing problems.
In other words, can I get a reference on a value type variable on the stack to use it later?
P.S. I am a C++ guy, that is why I as such stupid questions :)