- Home /
Check the toggle status of other game objects from a script
Hello community. I am building a topics selection menu with one toggle per topic. I have managed without scripting to make it so that when the toggle for the "ALL" button is set to ON all other toggles are set to ON also. Basically a "one sets all" kind of event. However now I need an "all set one" event. That is, when all the toggles other than the "ALL" toggle are set to ON, the "ALL" toggle should change to ON as well. I don't seem to find a way without scripting and I am VERY new to C#. I guess I would need to attach a script component to the "ALL" toggle where I check the boolean state of the other toggles with an "if" method that would change the boolean state of the "ALL" toggle to true if the other toggles are ON. Well, I don't know how to script that. My main issue is how to check the toggle status of other game objects from a script. I would appreciate ANY direction to a solution. Thanks!
Your answer
Follow this Question
Related Questions
How to link buttons to individual levels within the same scene? 1 Answer
Move UI panel 1 Answer
How do i detect if toggle has been unchecked 0 Answers
Unity Character Selection + store 1 Answer
Circular scrolling Main Menu. 0 Answers