【Unity3D自学记录】遍历父物体下所有子物体

来源:互联网 发布:游戏人物设计软件 编辑:程序博客网 时间:2024/06/10 07:42
using UnityEngine;using System.Collections;public class ResourcesLoadObj : MonoBehaviour{    void Start()    {        foreach (Transform child in gameObject.transform)        {            Debug.Log("所有该脚本的物体下的子物体名称:"+child.name);        }    }}


0 0
原创粉丝点击