can't get desired rotation angles

while an object is rotating if it rotates to a certain angle ex: ( -50 and 50) I want the scene to change. I’ve gotten the object to rotate, I’ve gotten the scenes/UI to update, but I can’t find any method or float that’ll execute if the rotation is == to my desired angle.

My Code:

if (transform.eulerAngles.z > 50f)
{
GameOver(GameIsOver = true);
}
else if (transform.eulerAngles.z < -50f)
{
GameOver(GameIsOver = true);
}

eualerAngles are not values from -180 to 180. Instead, it’s from 0 to 360. I would recommend a solution something like this.

    if (transform.eulerAngles.z > 50 && transform.eulerAngles.z < 310)
    {
        GameOver(GameIsOver = true);
    }
    else if (transform.eulerAngles.z > 310)
    {
         GameOver(GameIsOver = true);
    }

(The second condition: 360 - 50 = 310)