I have assigned script to a few game objects with UI childs this script for visibility controll when GUI items are showed:
using UnityEngine;
using System.Collections;
public class VisibleByCheckbox : MonoBehaviour
{
public UICheckbox cb;
void OnEnable()
{
NGUITools.SetActive(this.gameObject,cb.isChecked);
}
void OnDisable()
{
NGUITools.SetActive(this.gameObject,cb.isChecked);
}
}
but NGUITools.SetActive command enable only parent and not all child objects.
On checkbox is assigned UICheckboxControlledComponent for hide/show GUI groups and workls well, parent and child objects are hide/show.
It's strange.