1
NGUI 3 Support / Re: UIToggle Not Changing value
« on: June 10, 2014, 07:41:05 AM »
Also if I use a code like this
then it will turn on using
but it will not turn off even when turnOn = false.
This also only happens when there is a group assigned.
- public bool turnOn;
- // Update is called once per frame
- void Update () {
- if(turnOn == false){
- gameObject.GetComponent<UIToggle>().value = false;
- }
- if(turnOn == true){
- gameObject.GetComponent<UIToggle>().value = true;
- }
- }
then it will turn on using
- gameObject.GetComponent<UIToggle>().value = true;
but it will not turn off even when turnOn = false.
This also only happens when there is a group assigned.

! You gave to add an EventDelegate.