You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
308 B

using System.Linq;
using UnityEngine;
namespace Utils
{
public static class TransformUtils {
public static void Clear(this Transform transform)
{
foreach (Transform child in transform.Cast<Transform>().ToArray())
{
child.parent = null;
Object.Destroy(child.gameObject);
}
}
}
}