Created
June 5, 2015 16:26
-
-
Save peroon/f3a50dc975fe5384c5bc to your computer and use it in GitHub Desktop.
直下の子供全削除
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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