Noob Coder here, I’m wondering how to be able to manage multiple Boolean variables, switching some on and off while also being able to add more booleans, I think I’m supposed to use a foreach or I’m supposed to not even use booleans? Any sort of help is appreciated
public class AbilityManager : MonoBehaviour
{
public bool[] Abilities;
// Start is called before the first frame update
void Update()
{
if(Abilities[0] == true)
{
Abilities[1] = false;
Abilities[2] = false;
Abilities[3] = false;
Abilities[4] = false;
}
if (Abilities[1] == true)
{
Abilities[0] = false;
Abilities[2] = false;
Abilities[3] = false;
Abilities[4] = false;
}
}
}