GetComponentsInChildren<Transform>(true)

GetComponentsInChildren<Transform>(true);//游戏对象下的子物体激活的没激活的都会被拿到,包括游戏对象本身
GetComponentsInChildren<Transform>(false);//游戏对象下的子物体激活的会被拿到,包括游戏对象本身;没激活的不会被拿到
另外,()不写的活默认为false.
原文地址:https://www.cnblogs.com/mcyushao/p/11225071.html