Example #1
0
        static public void DestroyAllChildren2D(RectTransform t)
        {
            if (t.childCount == 0)
            {
                return;
            }
            var c = new RectTransform[t.childCount];

            int i = 0;

            foreach (RectTransform ct in t)
            {
                c[i] = ct;
                i++;
            }

            foreach (var p in c)
            {
                GK.Destroy(p.gameObject);
            }
        }