コード例 #1
0
        /// <summary>
        /// Force to clean all the children, this will make sure the
        /// transform have 0 children transform.
        /// </summary>
        /// <param name="trans"> transform you want to remove all
        /// the children under. </param>
        /// <returns>
        /// All the children under as a list.
        /// </returns>
        public static List <Transform> ForceDetachChildren(Transform trans)
        {
            List <Transform> childs = null;

            while (trans.childCount != 0)
            {
                List <Transform> tmpChilds = JCS_Utility.DetachChildren(trans);

                childs = MergeList(tmpChilds, childs);
            }

            return(childs);
        }