I have some checks to see if a screen is active. The code looks like this:
if (GUI.Button(new Rect(Screen.width / 2 - 10, 50, 50, 30), \"Rules\")) //Creates
This would be inlined, so readability increases, runtime costs stays the same:
public static bool Invert(this bool val) { return !val; }
To give:
ruleScreenActive.Invert();
I think it is better to write:
ruleScreenActive ^= true;
that way you avoid writing the variable name twice ... which can lead to errors
You can get rid of your if/else statements by negating the bool's value:
ruleScreenActive = !ruleScreenActive;
ruleScreenActive = !ruleScreenActive;