Created
August 19, 2018 10:04
-
-
Save HassakuTb/ced1125d6a8bd0da9131864347a133b8 to your computer and use it in GitHub Desktop.
Destroy all children of GameObject
This file contains hidden or 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 partial class TransformExtentions { | |
public static void DestroyAllChildren(this Transform tf) { | |
foreach(Transform t in tf) { | |
GameObject.Destroy(t.gameObject); | |
} | |
tf.DetachChildren(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment