Mecanim 发表于 2022-12-26 18:41

Unity 遍历子物体的两种方式

第一种:
foreach (Transform child in parent){   print(child.name);}
第二种:
for (int i = 0; i < parent.childCount; i++) {   Transform child = parent.GetChild(i);   print(child.name);}
页: [1]
查看完整版本: Unity 遍历子物体的两种方式