Question by
CLDavi · Feb 15, 2021 at 05:11 AM ·
c#programmingboolean
Automatic Switching of two or more booleans in Inspector
I am relatively new to this program, so I am wondering, I am working with booleans, yet I am after a result where making one boolean true, makes another false, and vice versa, in the Inspector. I am using the ScriptableObject function to produce the assets, or "Items" for the game. Is there some solution towards accomplishing the goal, or is there something better?
The Item types are "Weapon", "Defense", "Restore", and "Boost".
If anyone can help me with this, I would greatly appreciate it.
Comment
Answer by AbandonedCrypt · Feb 15, 2021 at 09:21 AM
Your question really doesn't make too much sense, where do your booleans come into play?
In general a function to switch boolean states is very simple:
void SwitchBools()
{
boolA = !boolA;
boolB = !boolB;
boolC = !boolC;
}