set bool on rotation

How do I make bool set to true when object is rotated 90 degrees ? And when it is rotated 45, 30 etc… degrees make it false ?

If you want it to be ONLY true for the instance where the object hit 90° throughout its rotation you could do something like

if(Mathf.RoundToInt(transform.rotation.EulerAngles.y) == 90)
    b = true;
else
    b = false;

(note that this could possibly fail if your framerate-roationspeed setup results in large rotation intervals)

if you want it to be true after a certain threshold you could do

if(transform.rotation.EulerAngles.y > 90)
    b = true;
else
    b = false;

Since i am on my browser rn and dont have a code editor or intellisense, just take this as pseudocode.