Toggle Attack Buttons

In my game, I have “Peace Mode” and “Combat Mode.” I want the buttons for different kinds of attacks to be disabled until you press the toggle. Also Ranged Mode to use ranged weapons. That would indicate a toggle group, but I’m not sure how to do that in code. Could someone walk me through the process?
Thanks!

Inside your click events for your attack buttons, assuming you have those set up, you can check a boolean value to see if it’s ‘toggled’ or not before doing any of the code.

The boolean value will be set depending on which button is clicked, Peace Mode or Combat Mode.

Example:
If you are using http://docs.unity3d.com/ScriptReference/UI.Button.html
Then for the Peace Mode and Combat Mode buttons:

bool isPeaceMode = true;
void onPointerDown/OnClick/onMouseDown(....) {
  isPeaceMode = true/false; 
}

A true or false value depends on which button is clicked. If the Peace Mode button is clicked, set isPeaceMode to true. if the Combat mode button is clicked, set isPeaceMode to false.

Then for your attack buttons:

void onPointerDown/OnClick/onMouseDown(....) {
  if (!isPeaceMode) {
    <do attack>
}

One thing to note is that you will need a reference to the isPeaceMode boolean value. I’ll leave that to you to figure out.