using UnityEngine;
using System.Collections;
public class ResourcesLoadObj : MonoBehaviour
{
void Start()
{
foreach (Transform child in gameObject.transform)
{
Debug.Log("所有该脚本的物体下的子物体名称:"+child.name);
}
}
}

本文介绍了一个使用C#的MonoBehaviour脚本,用于在Unity中遍历并打印所有带有该脚本的对象下的子物体名称。
3010

被折叠的 条评论
为什么被折叠?



