bool toggle unity c#

C#
private bool togl;

togl = !togl; //this is what changes the bool the the other state
Source

Also in C#: