Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class DisableAllButtonsExcept : MonoBehaviour
  7. // Created by Radixious toturials
  8. {
  9. public GameObject[] exceptions;
  10.  
  11. public void DisableButtons()
  12. {
  13. GameObject[] buttons = GameObject.FindGameObjectsWithTag("button");
  14.  
  15. foreach (GameObject g in buttons)
  16. {
  17. g.GetComponent<Button>().interactable = false;
  18.  
  19. }
  20. foreach (GameObject g in exceptions)
  21. {
  22. g.GetComponent<Button>().interactable = true;
  23.  
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement