Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class DisableAllButtonsExcept : MonoBehaviour
- // Created by Radixious toturials
- {
- public GameObject[] exceptions;
- public void DisableButtons()
- {
- GameObject[] buttons = GameObject.FindGameObjectsWithTag("button");
- foreach (GameObject g in buttons)
- {
- g.GetComponent<Button>().interactable = false;
- }
- foreach (GameObject g in exceptions)
- {
- g.GetComponent<Button>().interactable = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement