LaboratoryProtection/Assets/PMaker/Scripts/Extension/TransformExtension.cs

19 lines
369 B
C#

using System.Collections.Generic;
using UnityEngine;
namespace PMaker.Extension
{
public static class TransformExtension
{
public static IEnumerable<Transform> Children(this Transform root)
{
for (int i = 0; i < root.childCount; i++)
{
yield return root.GetChild(i);
}
}
}
}