unity获取子物体

1,使用GetComponentsInChildren来完成

Transform[] tran = gameObject.GetComponentsInChildren<transform>();

2,使用Find来完成:

transform.Find()

3,使用GetChild()

transform.GetChild()

猜你喜欢

转载自blog.csdn.net/xinzhilinger/article/details/108835527