1
0
Fork 0
LaboratoryProtection/Assets/PMaker/Scripts/Extension/TransformExtension.cs

19 lines
369 B
C#
Raw Normal View History

2023-09-12 15:55:51 +08:00
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);
}
}
}
}