Example #1
0
 public void removeChild(Layer child)
 {
     UT.destroy(child.rootObject());
     child.uninit();
     mChild.Remove(child);
     child.mParent = null;
 }
Example #2
0
    public static void destroyAllChild(GameObject obj)
    {
        Transform parent = obj.transform;

        Transform[] childs = new Transform[parent.childCount];
        for (int i = 0; i < childs.Length; i++)
        {
            childs[i] = parent.GetChild(i);
        }

        foreach (Transform child in childs)
        {
            UT.destroy(child.gameObject);
        }
    }