Whats going on here? Why isn’t the = working? It’s not a value type so it should be passing by reference right?
void func()
{
Vector2 a = new Vector2(1, 0);
equal(a);
// a is now (1, 0) not (0, 0)
}
void equal(Vector2 a)
{
a = new Vector2(0, 0);
}
Vector2isStructand struct type is avalue typenot reference. userefkeyword passing by reference