示例#1
0
    public static void SetActiveChildren(GameObject go, bool state)
    {
        Transform transform = go.get_transform();

        if (state)
        {
            int i          = 0;
            int childCount = transform.get_childCount();
            while (i < childCount)
            {
                Transform child = transform.GetChild(i);
                UGUITools.Activate(child, true);
                i++;
            }
        }
        else
        {
            int j           = 0;
            int childCount2 = transform.get_childCount();
            while (j < childCount2)
            {
                Transform child2 = transform.GetChild(j);
                UGUITools.Deactivate(child2);
                j++;
            }
        }
    }