ok im not really sure how to ask this but maybe someone can help.
I would like to reduce one of these blocks of code …
void NotPressed ()
{
for (int i = 0; i < DangerousObjects.Count; i++)
{
isGroundButtonPressed = false;
DangerousObjects*.SetActive(true);*
animator.SetBool(“GroundButtonOn”, false);
}
}
void Pressed()
{
for (int i = 0; i < DangerousObjects.Count; i++)
{
isGroundButtonPressed = true;
DangerousObjects*.SetActive(false);*
animator.SetBool(“GroundButtonOn”, true);
}
}
so it can be something like this
void NotPressed ()
{
!Pressed();
}
void Pressed(bool isPressed)
{
for (int i = 0; i < DangerousObjects.Count; i++)
{
isGroundButtonPressed = true;
DangerousObjects*.SetActive(false);*
animator.SetBool(“GroundButtonOn”, true);
}
}
that doesnt work^ but im looking to do something like that.i dont need to do this – i just want to know how someone one would go about doing that? is there a way i can flip all the boolean values to it’s opposite value?