unity3d遍历出Cube里面所有子对象
 cube目录下有n个cube,可不可以一下子遍历出所有的对象,而不用一个一个的find?find(“Cube1”)
 
1、foreach(Transform ts in cube)
 
2、cube.getCompontsInChildren
 
返回transform的数组
 
3、GameObject[] gos;  gos = GameObject.FindGameObjectsWithTag("Enemy");

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案