GameObjectExtensions.DestroyAllChildren
Extension Method in GameObjectExtensions
Declaration
public static void DestroyAllChildren(this GameObject gameObject, bool immediate = false, bool allowDestroyingAssets = false)Description
Destroys all children game objects.
Parameters
| gameObject | The game object to destroy all children of. |
| immediate | Destroys the game objects immediately (not recommended). |
| allowDestroyingAssets | Allows project assets to be destroyed (not recommended). |
Overload
Declaration
public static void DestroyAllChildren(this GameObject gameObject, float delay)Description
Destroys all children game objects after a delay.
Parameters
| gameObject | The game object to destroy all children of. |
| delay | The delay before destroying the game objects. |