Hi Guys.
Currently I am inverting an Animator Controller boolean parameter as follows in C#:
private Animator ac;
private bool DoorOpenBool = false;
void Start () {
ac=GetComponent<Animator>();
}
void OnMouseDown(){
DoorOpenBool=!DoorOpenBool;
ac.SetBool("DoorOpen", DoorOpenBool);
}
This obviously works fine, but as a matter of curiosity, is there a way to invert the SetBool directly rather than indirectly though another Bool? For example (I’m aware that this wouldn’t work!):
private Animator ac;
void Start () {
ac=GetComponent<Animator>();
}
void OnMouseDown(){
ac.SetBool(!"DoorOpen");
}
The only real benefit being saving typing a couple of lines of code, just a matter of curiosity really.
Thanks!