📅  最后修改于: 2022-03-11 14:49:19.244000             🧑  作者: Mango
private bool togl;//this is either true or false
if (Input.GetKey(KeyCode.A)) //can have whatever statment you want here
{
togl = !togl; //this is what changes the bool
}