I need some help here. I read the y angle of a transform and test it against <=180.0f which fails. Debug.Log and the inspector however say different. And it should be exact 180.0f because I set the transfrom up that way before.
private float camStartAngleY;
camStartAngleY = transform.localEulerAngles.y;
if (camStartAngleY < 0.0f) camStartAngleY += 360.0f; // make sure value stays between 0 and 360
else if (camStartAngleY > 360.0f) camStartAngleY -= 360.0f;
Debug.Log ("camStartAngleY: " + camStartAngleY);
if (camStartAngleY < 180.0f || camStartAngleY == 180.0f)
{
Debug.Log ("<=180: " + camStartAngleY);
}
Debug.Log says:
camStartAngleY: 180
UnityEngine.Debug:Log(Object)
So what is going on here?