/// <summary>
/// 查找父物体下所有物体
/// </summary>
/// <param name="transform"></param>
/// <param name="name"></param>
/// <returns></returns>
public Transform FindChildInTransfromAllChild(Transform transform, string name)
{
if (transform == null)
{
return null;
}
Transform[] childArray = transform.GetComponentsInChildren<Transform>(true);
List<Transform> childList = childArray.ToList();
return childList.Find(value => value.name == name);
}
unity 查找父物体下所有物体
最新推荐文章于 2023-12-20 17:41:00 发布