19 lines
547 B
C#
19 lines
547 B
C#
using System;
|
|
using UnityEngine;
|
|
using Object = UnityEngine.Object;
|
|
|
|
namespace RebootKit.Engine.Extensions {
|
|
public static class TransformEx {
|
|
public static void DestroyChildren(this Transform transform) {
|
|
foreach (Transform child in transform) {
|
|
Object.Destroy(child);
|
|
}
|
|
}
|
|
|
|
public static void ForEachChild(this Transform transform, Action<Transform> action) {
|
|
foreach (Transform child in transform) {
|
|
action(child);
|
|
}
|
|
}
|
|
}
|
|
} |