Skip to main content
added 62 characters in body
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Find OperationFind operation are costly operations: try to avoid them. Make

Make a public ListList and assign youyour buttons to that ListList and then iterate the listList.

   public List<GameObject> allButton; // it will show in your inspector assign (Drag and 
                                      // Drop) all your buttons to this list. 

   public void ShowAllButtons(){

      for(int index=0; index < allButton.Count; index++ ){
         allButton..SetActive(true);
      }

   }

Find Operation are costly operations try to avoid them. Make a public List and assign you buttons to that List and then iterate the list.

   public List<GameObject> allButton; // it will show in your inspector assign (Drag and Drop) all your buttons to this list. 

   public void ShowAllButtons(){

      for(int index=0; index < allButton.Count; index++ ){
         allButton..SetActive(true);
      }

}

Find operation are costly operations: try to avoid them.

Make a public List and assign your buttons to that List and then iterate the List.

   public List<GameObject> allButton; // it will show in your inspector assign (Drag and 
                                      // Drop) all your buttons to this list. 

   public void ShowAllButtons(){

      for(int index=0; index < allButton.Count; index++ ){
         allButton..SetActive(true);
      }

   }
Source Link

Find Operation are costly operations try to avoid them. Make a public List and assign you buttons to that List and then iterate the list.

   public List<GameObject> allButton; // it will show in your inspector assign (Drag and Drop) all your buttons to this list. 

   public void ShowAllButtons(){

      for(int index=0; index < allButton.Count; index++ ){
         allButton..SetActive(true);
      }

}