1、使用 transform.Find("name");
transform.Find("name");
2、设置 GetComponentInChildren<>(true); 包含 active 为 false 的子物体
transform.GetComponentInChildren<>(true);//includeInactive
本文介绍了Unity中使用transform.Find和GetComponentInChildren方法来精确查找子物体的技术。通过transform.Find可以通过名称定位GameObject;使用GetComponentInChildren并设置参数true可以包含active状态为false的子物体组件。
transform.Find("name");
transform.GetComponentInChildren<>(true);//includeInactive
2万+
1991

被折叠的 条评论
为什么被折叠?