Skip to content

Instantly share code, notes, and snippets.

@peroon
Created June 5, 2015 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peroon/f3a50dc975fe5384c5bc to your computer and use it in GitHub Desktop.
Save peroon/f3a50dc975fe5384c5bc to your computer and use it in GitHub Desktop.
直下の子供全削除
using UnityEngine;
public static class TransformExtensions
{
// 直下の子供全削除
public static void DestroyAllChildren(this Transform self)
{
foreach (Transform trans in self) {
Object.Destroy(trans.gameObject);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment