Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: cheerbase on May 22, 2012, 01:59:45 AM

Title: set radiobutton with scripts
Post by: cheerbase on May 22, 2012, 01:59:45 AM
I use several UICheckboxs to form a Radio Group.Everything is perfect.
But how can i choose a specify checkbox with scripts?
Title: Re: set radiobutton with scripts
Post by: ENAY on May 22, 2012, 02:17:20 AM
I am not quite sure if this will answer your question, but you can get at a specific IUCheckBox if you have many by doing the following:-



        UICheckbox[] checkbox_list = TheMenuObj.GetComponentsInChildren<UICheckbox>();

        foreach (UICheckbox checkbox in checkbox_list)
        {
            if (checkbox.name == "My CheckBox Name")
            {
                // Do something
            }
        }
Title: Re: set radiobutton with scripts
Post by: ArenMook on May 22, 2012, 09:03:22 AM
And remember, UICheckbox.current will always tell you the checkbox that fired the event in your OnActivate function calls.