void GetChildrenAndSetActive()
    {
        Transform[] imageTargetObjects = GetComponentsInChildren<Transform>();
        //注意:index=0的时候获取的是它自身,因此遍历要从1开始
        for (int index = 1; index < imageTargetObjects.Length; index++)
        {
            imageTargetObjects[index].gameObject.SetActive(true);
            Debug.Log(imageTargetObjects[index].name);
        }
    }

相关文章:

  • 2021-06-02
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-28
  • 2021-08-30
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案