comparing eulerangles

Hi,

I have a puzzle block, that I want to check if its rotation equals 180 degrees on the y-axis.

if(puzzleblocks[0].transform.localEulerAngles.y == Vector3(0.0,180.0,0.0)) {
print("block 1 turned");
}

I also tried:

if(puzzleblocks[0].transform.localEulerAngles.y == 180) {
print("block 1 turned");
}

both to no result, it just wont print the line.

any help would be appreciated, thanks in advance

edit: I used localEulerangles, because it is a child of the Main Camera

You second attempt looks right - but remember that Vector3 values are floats and so not accurate - you would normally do:

 if((someFloatingPointValue - 180) < float.Epsilon) {

Of you could use another value - float.Epsilon is the smallest value a float can take.