What exactly does this operator |=
do?
I have this code for Unity in C#
bool shoot = Input.GetButtonDown("Fire1");
shoot |= Input.GetButtonDown("Fire2");
What exactly does this operator |=
do?
I have this code for Unity in C#
bool shoot = Input.GetButtonDown("Fire1");
shoot |= Input.GetButtonDown("Fire2");
is an OR assignment operator
is equivalento to:
shoot = shoot | Input.GetButtonDown("Fire2");