I have a 3x3 boolean 2D array in my C# code. I want to rotate the values of the array around the [1,1] axis (the middle). I tried copying the values into a new 2D array then overriding the old 2D array by the new values from the new one, but for some reason the new 2D array always seems to change its [1,0] value from 'true' to 'false' even though I don't override it in any way inside my code, it just seems to change itself alone.
Here is the piece of code i'm having a problem with.
bool[,] OldGrid = blockGrid;
print(OldGrid[0, 1] + " " + blockGrid[0, 1]);
blockGrid[0, 0] = OldGrid[0, 2];
blockGrid[0, 1] = OldGrid[1, 2];
blockGrid[0, 2] = OldGrid[2, 2];
print(OldGrid[0, 1] + " " + blockGrid[0, 1]);
The first print method always returns 'TRUE TRUE'
While the second one always returns 'FALSE FALSE'
Although it should return 'TRUE FALSE'