- Home /
how to set debug error after click button if I didn't check all toggles ?
how to set debug error after click button if I didn't check all toggles ?
Comment
Best Answer
Answer by zero_null · Dec 27, 2017 at 08:19 AM
You need to have all the toggles in an array or list and check the status if it's set in the
Toggle [] tglLst;
void Start(){
tglLst = _TOGGLE_PARENT_.GetComponentsInChildren<Toggle>();
}
void OnClickButtonCheck){
foreach(item e in tglLst){
if(!item.isOn){
Debug.LogError("Not every toggle is checked");
}
}
Debug.LogFormat("All Toggles Checked");
}
Your answer
Follow this Question
Related Questions
Toggling through music 1 Answer
Is there a toggle for snap to grid? 10 Answers
Press key to toggle pointlight on/off 1 Answer
GUI Button selected changes color and stays until another button is clicked 1 Answer
Particle System Toggle in Custom editor 3 Answers