Files
Cielonos/Assets/Scripts/SLSUtilities/SLSFramework/General/TransformExtension.cs
SoulliesOfficial 7ee2894a63 整合SLSUtilities
2026-01-17 11:35:49 -05:00

24 lines
637 B
C#

using Lean.Pool;
using UnityEngine;
namespace SLSFramework.General
{
public static class TransformExtension
{
public static void DestroyAllChildren(this Transform transform)
{
for (int i = transform.childCount - 1; i >= 0; i--)
{
Object.Destroy(transform.GetChild(i).gameObject);
}
}
public static void DespawnAllChildren(this Transform transform)
{
for (int i = transform.childCount - 1; i >= 0; i--)
{
LeanPool.Despawn(transform.GetChild(i).gameObject);
}
}
}
}