I want to compare two arrays and if all the values are the same i will do some stuff. I write a function like this to check is there any different value. If so return false.
bool Deneme ()
{
for (int i = 0; i < correctOnes.Length; i++) {
if(correctOnes[i] != cubeRotation[i].rotation.eulerAngles)
{
return false;
}
}
return true;
}
When I call the Deneme function it always return false. However, I check the array values in the console they are all same. Any ideas what is going on ?
Checking the console like that
for (int i = 0; i < correctOnes.Length; i++) {
Debug.Log ("Corrects: " + correctOnes[i]);
Debug.Log ("Cubes: " + cubeRotation[i].rotation.eulerAngles);
}