Answer the question
In order to leave comments, you need to log in
Unity3D. C#. How to check 9 variables (toggle) in a loop?
Good day. There are 9 checkboxes (Toggle). These are the categories of questions.
I need to check if each checkbox is checked and, depending on this, understand whether to include a list of questions for this category or not. Please provide an example of such an implementation.
Answer the question
In order to leave comments, you need to log in
Rough decision in the forehead:
for (i = 0; i < boolArray.Length; i++) {
if (boolArray[i]) {
//add a list of questions %i%
}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question